[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode a227f7e 200/385: blank lines end a run of
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode a227f7e 200/385: blank lines end a run of type definitions |
Date: |
Tue, 5 Oct 2021 23:59:31 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit a227f7eb401ed3dc1f1deae5d70357afccae9ed9
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
blank lines end a run of type definitions
---
haskell-tng-smie.el | 9 ++++++++-
test/src/indentation-options1.hs.append.indent | 2 +-
test/src/indentation-options2.hs.append.indent | 4 ++--
test/src/indentation.hs.append.indent | 6 +++---
4 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index 081b7f4..b0c6937 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -260,7 +260,8 @@ information, to aid in the creation of new rules."
"|")
((and (member parent '("::" "=>"))
- (< (--count (equal it "=>") prevline) 2))
+ (< (--count (equal it "=>") prevline) 2)
+ (not (haskell-tng--smie-prev-line-blank-p)))
"=>")
((haskell-tng--smie-search-prev-line
@@ -509,6 +510,12 @@ Inspired by `smie-indent--parent', which can only be used
in
(beginning-of-line)
(re-search-forward regexp (line-end-position) t)))
+(defun haskell-tng--smie-prev-line-blank-p ()
+ "t if the previous line is blank, not even comments or whitespace."
+ (save-excursion
+ (forward-line -1)
+ (= (line-beginning-position) (line-end-position))))
+
;; TODO smie-powered non-indentation features, e.g. sort-list
;; SMIE wishlist, in order of desirability:
diff --git a/test/src/indentation-options1.hs.append.indent
b/test/src/indentation-options1.hs.append.indent
index 841deb0..a00ae6e 100644
--- a/test/src/indentation-options1.hs.append.indent
+++ b/test/src/indentation-options1.hs.append.indent
@@ -15,4 +15,4 @@ types4 ::
-> c
1 v2
-1 v2
\ No newline at end of file
+v 12
\ No newline at end of file
diff --git a/test/src/indentation-options2.hs.append.indent
b/test/src/indentation-options2.hs.append.indent
index 8b50cd8..4b0dc8b 100644
--- a/test/src/indentation-options2.hs.append.indent
+++ b/test/src/indentation-options2.hs.append.indent
@@ -15,7 +15,7 @@ types5 :: Monad m
-> c
1 v
-1 v
+v 1
types6 ::
1 v
( Monad m )
@@ -27,4 +27,4 @@ types6 ::
-> c
1 v2
-1 v2
\ No newline at end of file
+v 12
\ No newline at end of file
diff --git a/test/src/indentation.hs.append.indent
b/test/src/indentation.hs.append.indent
index 14ee722..b039658 100644
--- a/test/src/indentation.hs.append.indent
+++ b/test/src/indentation.hs.append.indent
@@ -261,7 +261,7 @@ types1 ::
-> c
1 v 2
-1 v 2
+v 1 2
types2 :: (Monad m, MemberLogger m)
1 v
=> a
@@ -271,7 +271,7 @@ types2 :: (Monad m, MemberLogger m)
-> c
1 v
-1 v
+v 1
types2b
1 v
:: (Monad m, MemberLogger m)
@@ -283,7 +283,7 @@ types2b
-> c
1 v
-1 v
+v 1
types3 :: (Monad m, MonadReader Foo m) =>
1 v
(?log :: HasLogger m) =>
- [nongnu] elpa/haskell-tng-mode bc5c827 160/385: tuple indentation, (continued)
- [nongnu] elpa/haskell-tng-mode bc5c827 160/385: tuple indentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e0acc42 156/385: better tasty error detection, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c211672 174/385: indentation for hanging type definition, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ef7f335 171/385: note stack compatibility, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 86bcd98 175/385: constraint indentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e1c0f0a 179/385: allow indentation option to be tested, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 1cceb64 182/385: cleaner tests, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b1122e4 188/385: allow users to use unsupported build tools, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode bd4ff6f 192/385: standardise on naming convention:, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3b5ac7f 190/385: package-lint, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a227f7e 200/385: blank lines end a run of type definitions,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode e4ead98 201/385: thots on prettify-symbol, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 387aa18 203/385: more efficient layout algorithm, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode bfc3841 193/385: remove bind-key dependency, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6acba95 206/385: better insertion indentation on toplevels, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 9bfc6bf 215/385: really basic imenu, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f648cf9 212/385: fallback to current directory (e.g. for cabal scripts), ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 5bdf688 211/385: better in-line indentation of parens, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 1cdf901 120/385: better escape syntax detection, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c40c6e6 125/385: fix explicit export fontification bug, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 82312a2 126/385: working compilation matchers, ELPA Syncer, 2021/10/06