diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2015-12-02 20:12:54 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2015-12-02 20:13:06 -0700 |
commit | 2246fd5179f2579f511b0a7b211a3880d104ba41 (patch) | |
tree | 6ec03a7a950c269445694bbd273cf056e3a12044 /.emacs.d/site-lisp | |
parent | bb959c7058db9bba8d6edc94f4e99d8a300bceb7 (diff) | |
download | dotfiles-2246fd5179f2579f511b0a7b211a3880d104ba41.tar.gz |
haskell-tab-indent: ignore blank spacer lines
The indent of the current line should take account of the indent of the
previous non-blank (or non-whitespace-only) line, which might be the
line immediately previous.
Diffstat (limited to '.emacs.d/site-lisp')
-rw-r--r-- | .emacs.d/site-lisp/haskell-tab-indent.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/.emacs.d/site-lisp/haskell-tab-indent.el b/.emacs.d/site-lisp/haskell-tab-indent.el index 6711d3ae..cb44d421 100644 --- a/.emacs.d/site-lisp/haskell-tab-indent.el +++ b/.emacs.d/site-lisp/haskell-tab-indent.el @@ -91,7 +91,9 @@ (defun haskell-tab-indent--previous-line-tabs () (save-excursion - (forward-line -1) + (beginning-of-line 0) ; go up one line + ;; keep going up past blank spacer lines + (while (looking-at "[[:space:]]*$") (beginning-of-line 0)) (haskell-tab-indent--this-line-tabs))) (defun haskell-tab-indent--this-line-tabs () |