Use c-ts-common's comment setup in go-ts-mode (bug#75978)

c-ts-common-comment-setup sets up fill-paragraph-function, which
enables filling for comments.

* lisp/progmodes/go-ts-mode.el (go-ts-mode):
(go-mod-ts-mode): Use c-ts-common-comment-setup.
This commit is contained in:
Yuan Fu 2025-02-11 20:38:00 -08:00
parent 316893ca38
commit 1931425748
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -28,6 +28,7 @@
;;; Code:
(require 'treesit)
(require 'c-ts-common)
(eval-when-compile (require 'rx))
(declare-function treesit-parser-create "treesit.c")
@ -258,9 +259,7 @@
(treesit-parser-create 'go)
;; Comments.
(setq-local comment-start "// ")
(setq-local comment-end "")
(setq-local comment-start-skip (rx "//" (* (syntax whitespace))))
(c-ts-common-comment-setup)
;; Navigation.
(setq-local treesit-defun-type-regexp
@ -458,9 +457,7 @@ what the parent of the node would be if it were a node."
(treesit-parser-create 'gomod)
;; Comments.
(setq-local comment-start "// ")
(setq-local comment-end "")
(setq-local comment-start-skip (rx "//" (* (syntax whitespace))))
(c-ts-common-comment-setup)
;; Indent.
(setq-local indent-tabs-mode t