Make more granular defun-type-regexp (bug#59873)
We don't want to match local_variable_declaration and others to hit on beginning-of-defun. The fix is just to make the regexp a bit more granular. * lisp/progmodes/java-ts-mode.el (java-ts-mode): Use regexp-opt to distinguish more granularly.
This commit is contained in:
parent
8f49137c9b
commit
839341d737
1 changed files with 9 additions and 1 deletions
|
@ -321,7 +321,15 @@ the subtrees."
|
||||||
(append "{}():;," electric-indent-chars))
|
(append "{}():;," electric-indent-chars))
|
||||||
|
|
||||||
;; Navigation.
|
;; Navigation.
|
||||||
(setq-local treesit-defun-type-regexp "declaration")
|
(setq-local treesit-defun-type-regexp
|
||||||
|
(regexp-opt '("method_declaration"
|
||||||
|
"class_declaration"
|
||||||
|
"record_declaration"
|
||||||
|
"interface_declaration"
|
||||||
|
"enum_declaration"
|
||||||
|
"import_declaration"
|
||||||
|
"package_declaration"
|
||||||
|
"module_declaration")))
|
||||||
|
|
||||||
;; Font-lock.
|
;; Font-lock.
|
||||||
(setq-local treesit-font-lock-settings java-ts-mode--font-lock-settings)
|
(setq-local treesit-font-lock-settings java-ts-mode--font-lock-settings)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue