[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 6acba95 206/385: better insertion indenta
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 6acba95 206/385: better insertion indentation on toplevels |
Date: |
Tue, 5 Oct 2021 23:59:32 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 6acba95224953bae57253f3c2017cafd55f29a8b
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
better insertion indentation on toplevels
---
haskell-tng-smie.el | 3 +++
test/src/indentation.hs.insert.indent | 14 +++++++-------
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/haskell-tng-smie.el b/haskell-tng-smie.el
index b0c6937..bd0c157 100644
--- a/haskell-tng-smie.el
+++ b/haskell-tng-smie.el
@@ -342,6 +342,9 @@ information, to aid in the creation of new rules."
(haskell-tng--smie-rule-parent-column)
(smie-rule-parent)))
("::" 2)
+ ((guard (looking-at (rx "\n" (or word-start "("))))
+ ;; insertion before a top-level
+ '(column . 0))
("," (smie-rule-separator method))
;; TODO ; as a separator, might remove ad-hoc WLDO rules
((guard (smie-rule-parent-p "SYMID" "CONSYM" "KINDSYM"))
diff --git a/test/src/indentation.hs.insert.indent
b/test/src/indentation.hs.insert.indent
index ea3b0c7..782ec9f 100644
--- a/test/src/indentation.hs.insert.indent
+++ b/test/src/indentation.hs.insert.indent
@@ -57,7 +57,7 @@ basic_do = do
pure faz -- manual correction
1 v 2 34 5
-1 v 2 34 5
+v 1 2 34 5
nested_do = -- manual correction
2 v 1
do foo <- blah
@@ -67,7 +67,7 @@ nested_do = -- manual correction
baz -- same level as bar
1 2 v 3 4
-1 2 v 3 4
+v 1 2 3 4
nested_where a b = foo a b
1 v
where -- manual correction
@@ -83,7 +83,7 @@ nested_where a b = foo a b
faz = blah -- same level as gaz
1 2 v
-1 2 v
+v 1 2
let_in a b = let
1 v
blah = bloo
@@ -95,7 +95,7 @@ let_in a b = let
flibble blah
2 v 1
-1 v 2
+v 1 2
implicit_let foo bar =
2 v 1
let ?foo = foo
@@ -117,7 +117,7 @@ case_of wibble = case wibble of
fish
2 v 1
-1 v 2
+v 1 2
lambda_case = \case
1 v
Nothing -> ""
@@ -125,7 +125,7 @@ lambda_case = \case
Just fish -> fish
1 v
-1 v
+v 1
dollars f Nothing = f $
1 v
"" ""
@@ -147,7 +147,7 @@ not_dollars = do
here
2 v 1 3
-1 v 2 3
+v 1 2 3
data Wibble = Wibble Int
1 v
| Wobble Int
- [nongnu] elpa/haskell-tng-mode 86bcd98 175/385: constraint indentation, (continued)
- [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, 2021/10/06
- [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 <=
- [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
- [nongnu] elpa/haskell-tng-mode 794c80b 131/385: better indentation alts, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode d43fd73 141/385: more efficient indentation 'insert test, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a830fcb 135/385: reindention test, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode aa2a0ad 146/385: prefer --enable-tests, ELPA Syncer, 2021/10/06