[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-ts-mode 9566f23699 60/61: new indent funciton
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-ts-mode 9566f23699 60/61: new indent funciton |
Date: |
Wed, 4 Sep 2024 04:00:32 -0400 (EDT) |
branch: elpa/haskell-ts-mode
commit 9566f23699dadfbe00f90b38445c122d06e2390e
Author: pranshu <pranshusharma366@gmail.com>
Commit: pranshu <pranshusharma366@gmail.com>
new indent funciton
Replaced haskell-ts-indent-paragraph with a function based alt.
---
haskell-ts-mode.el | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/haskell-ts-mode.el b/haskell-ts-mode.el
index ff6ab5572e..463e17f3a3 100644
--- a/haskell-ts-mode.el
+++ b/haskell-ts-mode.el
@@ -287,17 +287,21 @@
(haskell-ts-defun-name node)
nil)))
-(defun haskell-ts-indent-para ()
- "Indent the current paragraph."
- (interactive)
- (when-let ((par (bounds-of-thing-at-point 'paragraph)))
- (indent-region (car par) (cdr par))))
+(defun haskell-ts-indent-defun (pos)
+ "Indent the current function."
+ (interactive "d")
+ (let ((node (treesit-node-at pos)))
+ (while (not (string-match
+ "declarations\\|haskell"
+ (treesit-node-type (treesit-node-parent node))))
+ (setq node (treesit-node-parent node)))
+ (indent-region (treesit-node-start node) (treesit-node-end node))))
(defvar haskell-ts-mode-map
(let ((km (make-sparse-keymap)))
(define-key km (kbd "C-c C-c") 'haskell-ts-compile-region-and-go)
(define-key km (kbd "C-c C-r") 'haskell-ts-run-haskell)
- (define-key km (kbd "C-M-q") 'haskell-ts-indent-para) ; For those who
don't have emacs 30
+ (define-key km (kbd "C-M-q") 'haskell-ts-indent-defun) ; For those who
don't have emacs 30
km)
"Map for haskell-ts-mode.")
- [nongnu] elpa/haskell-ts-mode 1525dc1dc7 06/61: ic, (continued)
- [nongnu] elpa/haskell-ts-mode 1525dc1dc7 06/61: ic, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode 020175db62 16/61: Major changes, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode 9f450166d8 39/61: better docu, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode 02f280400c 34/61: Added eglot supprt, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode 59c4c2a5a6 40/61: pattern matching docu, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode 58d158bef4 45/61: More linting, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode 998fc309bd 50/61: General code changes, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode 834f15a29d 42/61: temp, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode 4cf9f99d93 51/61: More changes, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode dd16b23b60 56/61: Fixed comment problems, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode 9566f23699 60/61: new indent funciton,
ELPA Syncer <=
- [nongnu] elpa/haskell-ts-mode c2d4c88738 57/61: run haskell changes, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode c49a063e9a 61/61: Fixed defcusotm, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode 44d5bdb92f 09/61: added intent docu to readme, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode 4886b37b9a 27/61: Fix comment problem, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode 5e58b16de5 08/61: Added indentation, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode d7554fc2ee 20/61: Major update to font lock, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode d9afd84e46 47/61: Linting fixes, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode bd85e76757 54/61: Fixed commint mode, as eariler ones did not work, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode baf2c373ca 38/61: f, ELPA Syncer, 2024/09/04
- [nongnu] elpa/haskell-ts-mode 4b14396789 37/61: Fixed ge and le sign in prettify sym mode and ss, ELPA Syncer, 2024/09/04