emacs-elpa-diffs
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]