diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-05-13 10:15:24 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-05-13 10:15:24 -0700 |
commit | 4ec956c578634b44122dd4ba20dcfd02c6b006a0 (patch) | |
tree | 51f68867f8cf003fb32d310f8b6f57ed0c134c76 | |
parent | c0bd13db0c3817aa23fffc790dbe4a1c5a0ad03b (diff) | |
download | haskell-tab-indent-4ec956c578634b44122dd4ba20dcfd02c6b006a0.tar.gz |
reset when current is at least one more than previous
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | NEWS.md | 6 | ||||
-rw-r--r-- | haskell-tab-indent.el | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -11,6 +11,12 @@ - Attempt to line up the first line of definitions with declarations on the previous line, rather than indenting further. +- Reset indentation when current indentation is at least one more than + the previous line, rather than just when it is exactly one more than + the previous line. + + This should make it easier to unindent more than one line. + - Drop reference to an old git subtrees script from README.md. - Code cleanup. diff --git a/haskell-tab-indent.el b/haskell-tab-indent.el index 723786d..678cffa 100644 --- a/haskell-tab-indent.el +++ b/haskell-tab-indent.el @@ -105,7 +105,7 @@ (not prev-line-decl)) ;; avoid indenting too little (and prev-line-decl (= 1 this-line-tabs))) - (if (= (1+ prev-line-tabs) this-line-tabs) + (if (>= this-line-tabs (1+ prev-line-tabs)) ;; reset (delete-region (line-beginning-position) (point)) ;; indent |