Fix electric indent bug in python-mode after dedenting colon
* list/progmodes/python.el (python-indent-post-self-insert-function): Use markers instead of positions when reindenting statement(s) after inserting electric colon to avoid reindenting too many statements (bug#22663). * test/lisp/progmodes/python-tests.el (python-indent-electric-colon-2): Improve test case to also verify the fix of bug#22663. Copyright-paperwork-exempt: yes
This commit is contained in:
committed by
Eli Zaretskii
parent
f6eacc468b
commit
a3c79d44cc
@@ -1161,10 +1161,13 @@ def b()
|
||||
if do:
|
||||
something()
|
||||
else
|
||||
outside
|
||||
"
|
||||
(python-tests-look-at "else")
|
||||
(goto-char (line-end-position))
|
||||
(python-tests-self-insert ":")
|
||||
(should (= (current-indentation) 0))
|
||||
(python-tests-look-at "outside")
|
||||
(should (= (current-indentation) 0))))
|
||||
|
||||
(ert-deftest python-indent-electric-colon-3 ()
|
||||
|
||||
Reference in New Issue
Block a user