aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp
diff options
context:
space:
mode:
authorJoel Rosdahl2018-12-27 16:52:07 +0100
committerEli Zaretskii2019-01-05 11:02:02 +0200
commita3c79d44ccb4f6503d0a8b02230ff7a41db64ff8 (patch)
tree9ce59ca12af69c9daa60a8374b66c60f8a0710a7 /test/lisp
parentf6eacc468b8539be482260fa569e7b5ece07f4a2 (diff)
downloademacs-a3c79d44ccb4f6503d0a8b02230ff7a41db64ff8.tar.gz
emacs-a3c79d44ccb4f6503d0a8b02230ff7a41db64ff8.zip
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
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/progmodes/python-tests.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index 34a05194dfa..94c846ecb16 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -1161,10 +1161,13 @@ def b()
1161if do: 1161if do:
1162 something() 1162 something()
1163 else 1163 else
1164outside
1164" 1165"
1165 (python-tests-look-at "else") 1166 (python-tests-look-at "else")
1166 (goto-char (line-end-position)) 1167 (goto-char (line-end-position))
1167 (python-tests-self-insert ":") 1168 (python-tests-self-insert ":")
1169 (should (= (current-indentation) 0))
1170 (python-tests-look-at "outside")
1168 (should (= (current-indentation) 0)))) 1171 (should (= (current-indentation) 0))))
1169 1172
1170(ert-deftest python-indent-electric-colon-3 () 1173(ert-deftest python-indent-electric-colon-3 ()