aboutsummaryrefslogtreecommitdiff
path: root/gsp-ts-mode.el
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-10-16 21:24:23 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-10-16 21:24:23 +0200
commit68121e16fc9efbe94cdc5535f622581e29e5a8e5 (patch)
treee0678ec7ccfd202499038cc75e483d43174602b8 /gsp-ts-mode.el
parenteb8c7a1d75181d1f2cd7b979e5df558b680ea128 (diff)
Make use of the simpler ‘electric-indent-chars’HEADmaster
Diffstat (limited to 'gsp-ts-mode.el')
-rw-r--r--gsp-ts-mode.el18
1 files changed, 1 insertions, 17 deletions
diff --git a/gsp-ts-mode.el b/gsp-ts-mode.el
index 91967cf..3481ba7 100644
--- a/gsp-ts-mode.el
+++ b/gsp-ts-mode.el
@@ -99,20 +99,6 @@ See the documentation for `treesit-simple-indent-rules' and
`treesit-simple-indent-presets' for more information.")
-;;; Integration with ‘electric-indent-mode’
-
-(defun gsp-ts-mode-electric-should-try-indent (char)
- "Electric indentation hook for `gsp-ts-mode'.
-This function is a hook for `electric-indent-functions' to trigger
-automatic indentation as you type.
-
-See the documentation for `electric-indent-mode' and
-`electric-indent-functions' for more information."
- ;; The documentation for ‘electric-indent-functions’ specifies that
- ;; this should return ‘t’ and not some arbitrary non-nil value.
- (and (= char ?\}) t))
-
-
;;; Major Mode Setup
(defun gsp-ts--setup ()
@@ -140,9 +126,7 @@ See the documentation for `electric-indent-mode' and
(gsp-ts--setup)
(with-eval-after-load 'electric
- (add-hook 'electric-indent-functions
- #'gsp-ts-mode-electric-should-try-indent
- nil :local)))
+ (add-to-list 'electric-indent-chars ?\})))
(provide 'gsp-ts-mode)
;;; gsp-ts-mode.el ends here