Commit 946bb6d2 authored by Noam Postavsky's avatar Noam Postavsky

Disable electric indent for python strings (Bug#29305)

* lisp/progmodes/python.el (python-indent-post-self-insert-function):
Do nothing when point or beginning of line is in string.
parent 35f1ed10
......@@ -1257,7 +1257,11 @@ This function is intended to be added to `post-self-insert-hook.'
If a line renders a paren alone, after adding a char before it,
the line will be re-indented automatically if needed."
(when (and electric-indent-mode
(eq (char-before) last-command-event))
(eq (char-before) last-command-event)
(not (python-syntax-context 'string))
(not (python-syntax-context 'string (syntax-ppss)))))
;; Electric indent inside parens
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment