summaryrefslogtreecommitdiff
path: root/test/lisp
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2018-12-27 16:52:07 +0100
committerEli Zaretskii <eliz@gnu.org>2019-01-05 11:02:02 +0200
commita3c79d44ccb4f6503d0a8b02230ff7a41db64ff8 (patch)
tree9ce59ca12af69c9daa60a8374b66c60f8a0710a7 /test/lisp
parentf6eacc468b8539be482260fa569e7b5ece07f4a2 (diff)
downloademacs-a3c79d44ccb4f6503d0a8b02230ff7a41db64ff8.tar.gz
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()
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 ()