diff options
-rw-r--r-- | NEWS.md | 4 | ||||
-rw-r--r-- | haskell-tab-indent.el | 6 |
2 files changed, 7 insertions, 3 deletions
@@ -15,8 +15,8 @@ - Always indent the first line of the contents of a where clause to one plus the level of the line containing 'where'. - When doing so, try to fix the indentation of the line containing - 'where' if it's not correct. + When doing so, ensure that the 'where' on the previous line is + preceded by two spaces. - When one of the above cases does not apply, default to indenting to the same level of the previous line, unless the user explicitly diff --git a/haskell-tab-indent.el b/haskell-tab-indent.el index 8ba205e..9515d2b 100644 --- a/haskell-tab-indent.el +++ b/haskell-tab-indent.el @@ -94,7 +94,11 @@ ;; more (prev-line-where ;; also ensure indentation of the 'where' is correct - (save-excursion (forward-line -1) (haskell-tab-indent)) + (save-excursion + (beginning-of-line 0) + (skip-chars-forward "\t") + (unless (looking-at " where$") + (insert " "))) (tabs (1+ prev-line-tabs))) ;; if the user explicitly requested an indent ;; change, cycle through the plausible indents |