diff options
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index d4226e5ce7b..9e09bfc5941 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1257,7 +1257,11 @@ This function is intended to be added to `post-self-insert-hook.' | |||
| 1257 | If a line renders a paren alone, after adding a char before it, | 1257 | If a line renders a paren alone, after adding a char before it, |
| 1258 | the line will be re-indented automatically if needed." | 1258 | the line will be re-indented automatically if needed." |
| 1259 | (when (and electric-indent-mode | 1259 | (when (and electric-indent-mode |
| 1260 | (eq (char-before) last-command-event)) | 1260 | (eq (char-before) last-command-event) |
| 1261 | (not (python-syntax-context 'string)) | ||
| 1262 | (save-excursion | ||
| 1263 | (beginning-of-line) | ||
| 1264 | (not (python-syntax-context 'string (syntax-ppss))))) | ||
| 1261 | (cond | 1265 | (cond |
| 1262 | ;; Electric indent inside parens | 1266 | ;; Electric indent inside parens |
| 1263 | ((and | 1267 | ((and |