Clean up "lst:setup-go"

This commit is contained in:
Gerard Vermeulen 2024-06-14 19:05:26 +02:00
parent 17a25a336c
commit 7ac3b2321f

View File

@ -4977,12 +4977,9 @@ Links for further investigation are:
#+name: lst:setup-go
#+begin_src emacs-lisp -n :results silent
(when (featurep 'treesit)
;; Set `tab-width' in `after-change-major-mode-hook' function too.
(setopt go-ts-mode-indent-offset 2)
(add-hook 'after-change-major-mode-hook
(defun on-go-ts-mode-hook ()
(when (derived-mode-p 'go-ts-mode 'go-mod-ts-mode)
(setq-local tab-width 2))))
(add-hook 'go-ts-mode-hook (lambda ()
(setq-local tab-width 2)))
(add-to-list 'auto-mode-alist `(,(rx ".go" eos) . go-ts-mode)))
#+end_src