aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-05-13 10:15:24 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-05-13 10:15:24 -0700
commit4ec956c578634b44122dd4ba20dcfd02c6b006a0 (patch)
tree51f68867f8cf003fb32d310f8b6f57ed0c134c76
parentc0bd13db0c3817aa23fffc790dbe4a1c5a0ad03b (diff)
downloadhaskell-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.md6
-rw-r--r--haskell-tab-indent.el2
2 files changed, 7 insertions, 1 deletions
diff --git a/NEWS.md b/NEWS.md
index b5cc9f5..cc06d73 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -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