Commit 86f1889a authored by Fabián Ezequiel Gallina's avatar Fabián Ezequiel Gallina Committed by Fabián Ezequiel Gallina
Browse files

Fixed indentation issue when indenting a python-indent-dedenter from end of line

parent 66bbb27f
...@@ -700,8 +700,7 @@ START is the buffer position where the sexp starts." ...@@ -700,8 +700,7 @@ START is the buffer position where the sexp starts."
(let* ((indentation (python-indent-calculate-indentation)) (let* ((indentation (python-indent-calculate-indentation))
(remainder (% indentation python-indent-offset)) (remainder (% indentation python-indent-offset))
(steps (/ (- indentation remainder) python-indent-offset))) (steps (/ (- indentation remainder) python-indent-offset)))
(setq python-indent-levels '()) (setq python-indent-levels '(0))
(setq python-indent-levels (cons 0 python-indent-levels))
(dotimes (step steps) (dotimes (step steps)
(setq python-indent-levels (setq python-indent-levels
(cons (* python-indent-offset (1+ step)) python-indent-levels))) (cons (* python-indent-offset (1+ step)) python-indent-levels)))
...@@ -740,7 +739,9 @@ to (`nth' `python-indent-current-level' `python-indent-levels')" ...@@ -740,7 +739,9 @@ to (`nth' `python-indent-current-level' `python-indent-levels')"
(if (or (and (eq this-command 'indent-for-tab-command) (if (or (and (eq this-command 'indent-for-tab-command)
(eq last-command this-command)) (eq last-command this-command))
force-toggle) force-toggle)
(python-indent-toggle-levels) (if (not (equal python-indent-levels '(0)))
(python-indent-calculate-levels)) (python-indent-calculate-levels))
(beginning-of-line) (beginning-of-line)
(delete-horizontal-space) (delete-horizontal-space)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment