[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode e1aba33 168/385: fix a layout bug in list
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode e1aba33 168/385: fix a layout bug in lists and records |
Date: |
Tue, 5 Oct 2021 23:59:24 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit e1aba33018735a48ff66f8f86eacd89050eec42c
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
fix a layout bug in lists and records
---
haskell-tng-layout.el | 12 +++---------
test/src/indentation.hs.insert.indent | 6 +++---
test/src/indentation.hs.layout | 12 ++++++------
test/src/indentation.hs.lexer | 12 ++++++------
test/src/indentation.hs.sexps | 12 ++++++------
5 files changed, 24 insertions(+), 30 deletions(-)
diff --git a/haskell-tng-layout.el b/haskell-tng-layout.el
index bdedb2f..3517708 100644
--- a/haskell-tng-layout.el
+++ b/haskell-tng-layout.el
@@ -36,14 +36,6 @@
(require 'haskell-tng-util)
-;; FIXME incorrect layout for brackets near the edge, don't add semis for
commas
-;; and parens.
-;;
-;; ;data Record1 = Record1 {
-;; fieldA :: String
-;; ;, fieldB :: String
-;; ;}
-
;; Easiest cache... full buffer parse with full invalidation on any insertion.
;;
;; A list of (OPEN . (CLOSE . SEPS)) positions, one per inferred block.
@@ -132,7 +124,9 @@ WLDO that is using the offside rule."
(forward-line)
(forward-comment (point-max))
(when (and (= (current-column) level)
- (not (eobp)))
+ (not (eobp))
+ (not (looking-at
+ (rx bol (or "," ")" "]" "}")))))
(push (point) seps))
(when (< limit (point))
(throw 'closed limit))
diff --git a/test/src/indentation.hs.insert.indent
b/test/src/indentation.hs.insert.indent
index 5be54f3..1cd66ca 100644
--- a/test/src/indentation.hs.insert.indent
+++ b/test/src/indentation.hs.insert.indent
@@ -159,7 +159,7 @@ v 1
data Record1 = Record1 {
1 v
fieldA :: String
-1 v
+v 1
, fieldB :: String
v
}
@@ -193,7 +193,7 @@ v 1 2
lists2 = [
1 v
foo
-1 v
+v 1
, bar
v
]
@@ -223,7 +223,7 @@ v 1 2
tuples2 = (
1 v
foo
-1 v
+v 1
, bar
v
)
diff --git a/test/src/indentation.hs.layout b/test/src/indentation.hs.layout
index c181fdf..7e363b8 100644
--- a/test/src/indentation.hs.layout
+++ b/test/src/indentation.hs.layout
@@ -79,8 +79,8 @@ module Indentation where
;data Record1 = Record1 {
fieldA :: String
-;, fieldB :: String
-;}
+, fieldB :: String
+}
;data Record2 = Record2
{ fieldA :: String
@@ -96,8 +96,8 @@ module Indentation where
;lists2 = [
foo
-;, bar
-;]
+, bar
+]
;lists3 = [ foo ,
bar ]
@@ -111,8 +111,8 @@ module Indentation where
;tuples2 = (
foo
-;, bar
-;)
+, bar
+)
;tuples3 = ( foo ,
bar )
diff --git a/test/src/indentation.hs.lexer b/test/src/indentation.hs.lexer
index b4eddbc..16bbe91 100644
--- a/test/src/indentation.hs.lexer
+++ b/test/src/indentation.hs.lexer
@@ -79,8 +79,8 @@ VARID
; data CONID = CONID «
VARID :: CONID
-; , VARID :: CONID
-; »
+, VARID :: CONID
+»
; data CONID = CONID
« VARID :: CONID
@@ -96,8 +96,8 @@ VARID :: CONID
; VARID = «
VARID
-; , VARID
-; »
+, VARID
+»
; VARID = « VARID ,
VARID »
@@ -111,8 +111,8 @@ VARID »
; VARID = «
VARID
-; , VARID
-; »
+, VARID
+»
; VARID = « VARID ,
VARID »
diff --git a/test/src/indentation.hs.sexps b/test/src/indentation.hs.sexps
index e149595..952103e 100644
--- a/test/src/indentation.hs.sexps
+++ b/test/src/indentation.hs.sexps
@@ -79,8 +79,8 @@
(data (Record1) = (Record1) ({
(fieldA) (::) (String)
-((, (fieldB) (::) (String))
-)}))
+, (fieldB) (::) (String)
+}))
(data (Record2) = (Record2)
({ (fieldA) (::) (String)
@@ -96,8 +96,8 @@
((lists2) = ([
(foo)
-((, (bar))
-)]))
+, (bar)
+]))
((lists3) = ([ (foo) ,
(bar) ]))
@@ -111,8 +111,8 @@
((tuples2) = (
(foo)
-((, (bar))
-)))
+, (bar)
+))
((tuples3) = ( (foo) ,
(bar) ))))))))))))))
- [nongnu] elpa/haskell-tng-mode 879fc34 130/385: thots, (continued)
- [nongnu] elpa/haskell-tng-mode 879fc34 130/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 1009082 140/385: append indentation test, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 88b17d4 137/385: started indentation rules, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode cf22f3a 138/385: simplify indentation testing, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a0f777e 166/385: Revert "duplicate ; tokens to be used as terminators", ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 2320b89 167/385: alternative to smie-rules-* in :elem and :list-intro, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 60d8c20 149/385: indent "case of", ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 7f9afd2 159/385: list indentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6e70344 165/385: duplicate ; tokens to be used as terminators, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode ab5252b 169/385: rearrange alts, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e1aba33 168/385: fix a layout bug in lists and records,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 2c6c772 150/385: better WLDO indentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3f54673 155/385: don't fontify toplevel, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 32175c0 158/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8c2e3f7 157/385: better symid indentation, ELPA Syncer, 2021/10/06
- [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