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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/haskell-ts-mode 5178ff240f 13/61: nl indent fix


From: ELPA Syncer
Subject: [nongnu] elpa/haskell-ts-mode 5178ff240f 13/61: nl indent fix
Date: Wed, 4 Sep 2024 04:00:27 -0400 (EDT)

branch: elpa/haskell-ts-mode
commit 5178ff240f56a152a4419db85d7b7ca8e4557f7c
Author: Pranshu Sharma <pranshusharma366@gmail.com>
Commit: Pranshu Sharma <pranshusharma366@gmail.com>

    nl indent fix
---
 haskell.el | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/haskell.el b/haskell.el
index 6b594aa5f7..b39639d3bf 100644
--- a/haskell.el
+++ b/haskell.el
@@ -46,27 +46,28 @@
 (setq haskell-ts-indent-rules
       `((haskell
         ((node-is "comment") column-0 0)
-        ((parent-is "haskell") column-0 0)
-        ((parent-is "declarations") column-0 0)
         ((parent-is "imports") column-0 0)
 
         ;; If then else
         ((node-is "then") parent 2)
         ((node-is "^else$") parent 2)
 
-        ;; lists
         ((node-is "^in$") parent 2)
  
         ((parent-is "apply") parent 2)
+        
         ;; Match
         ((match "match" nil nil 2 2) parent 2)
         ((node-is "match") prev-sibling 0)
+        ((parent-is "match") grand-parent 2)
+
+        
         ;; Do Hg
         ((lambda (node parent bol)
            (string= "do" (treesit-node-type (treesit-node-prev-sibling node))))
          grand-parent 0)
         ((parent-is "do") prev-sibling 0)
-        
+
         ((node-is "alternatives") grand-parent 0)
         ((parent-is "alternatives") grand-parent 2)
 
@@ -75,7 +76,7 @@
         ((parent-is "infix") parent 0)
 
         ((parent-is "data_constructors") parent 0)
-        
+
         ;; where
         ((lambda (node parent bol)
            (string= "where" (treesit-node-type (treesit-node-prev-sibling 
node))))
@@ -85,13 +86,10 @@
         ((parent-is "local_binds") prev-sibling 0)
         ((node-is "^where$") parent 2)
 
-        ;; Backup
-        ((lambda (a b c)
-           (save-excursion
-             (goto-char c)
-             (message "ee")
-             (re-search-forward "^[ \t]*$" (line-end-position) t)))
-         prev-adaptive-prefix 0))))
+        (no-node prev-adaptive-prefix 0)
+        ((parent-is "haskell") column-0 0)
+        ((parent-is "declarations") column-0 0)
+        )))
 
 
 ;;;###autoload
@@ -163,4 +161,4 @@
 (define-key haskell-ts-mode-map (kbd "C-c c") 'haskell-compile-region-and-go)
 (define-key haskell-ts-mode-map (kbd "C-c r") 'run-haskell)
 
-(add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode))
+;; (add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode))



reply via email to

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