Skip to content

Commit 8351070

Browse files
committed
Merge pull request #425 from gracjan/pr-haskell-simple-indent-backtab
Support for TABs in simple indent backtab.
2 parents 39630cb + d80559f commit 8351070

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

haskell-simple-indent.el

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,18 @@ column, `tab-to-tab-stop' is done instead."
128128
(defun haskell-simple-indent-backtab ()
129129
"Indent backwards. Dual to `haskell-simple-indent'."
130130
(interactive)
131-
(let ((current-point (point))
131+
(back-to-indentation)
132+
(let ((saved-column (current-column))
132133
(i 0)
133134
(x 0))
134-
(goto-char (line-beginning-position))
135+
(delete-region (line-beginning-position) (point))
136+
135137
(save-excursion
136-
(while (< (point) current-point)
138+
(while (< (current-column) saved-column)
137139
(haskell-simple-indent)
138140
(setq i (+ i 1))))
141+
(back-to-indentation)
142+
(delete-region (line-beginning-position) (point))
139143
(while (< x (- i 1))
140144
(haskell-simple-indent)
141145
(setq x (+ x 1)))))

0 commit comments

Comments
 (0)