Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a6a714e

Browse files
committed
(py-electric-colon): don't indent, only outdent.
1 parent 1a6c82f commit a6a714e

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Misc/python-mode.el

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,12 @@ argument is provided, that many colons are inserted non-electrically."
436436
(py-compute-indentation)))
437437
)
438438
(setq outdent py-indent-offset))
439-
;; electric colon won't re-indent lines that start in column
440-
;; zero. you'd have to use TAB for that. TBD: Is there a
441-
;; better way to determine this???
442-
(if (zerop (current-indentation)) nil
439+
;; electric colon won't re-indent lines that start to the left
440+
;; of the current computed indentation, under the assumption
441+
;; that these are already outdented properly. Use TAB, C-c C-l
442+
;; or C-c C-r to adjust. TBD: Is there a better way to
443+
;; determine this???
444+
(if (< (current-indentation) indent) nil
443445
(goto-char here)
444446
(beginning-of-line)
445447
(delete-horizontal-space)

0 commit comments

Comments
 (0)