mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
* lisp/progmodes/python.el (python-indent-post-self-insert-function):
Avoid electric colon at beginning-of-defun. * test/automated/python-tests.el: (python-indent-electric-colon-1): New test. (Bug#18228)
This commit is contained in:
parent
ad5c82a8cc
commit
0e4c8f1856
4 changed files with 31 additions and 1 deletions
|
|
@ -1155,9 +1155,15 @@ the line will be re-indented automatically if needed."
|
|||
((and (eq ?: last-command-event)
|
||||
(memq ?: electric-indent-chars)
|
||||
(not current-prefix-arg)
|
||||
;; Trigger electric colon only at end of line
|
||||
(eolp)
|
||||
;; Avoid re-indenting on extra colon
|
||||
(not (equal ?: (char-before (1- (point)))))
|
||||
(not (python-syntax-comment-or-string-p)))
|
||||
(not (python-syntax-comment-or-string-p))
|
||||
;; Never re-indent at beginning of defun
|
||||
(not (save-excursion
|
||||
(python-nav-beginning-of-statement)
|
||||
(python-info-looking-at-beginning-of-defun))))
|
||||
(python-indent-line)))))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue