diff options
| author | Theodor Thornhill | 2022-12-07 10:07:37 +0100 |
|---|---|---|
| committer | Yuan Fu | 2022-12-09 16:46:01 -0800 |
| commit | 839341d73707be2082abbd8834ba46292e59aeb7 (patch) | |
| tree | 596f1a3eb581a3598911a26527bb047cd0c4d4a2 /lisp | |
| parent | 8f49137c9bf614b285c19a3a845c7606fcba23a4 (diff) | |
| download | emacs-839341d73707be2082abbd8834ba46292e59aeb7.tar.gz emacs-839341d73707be2082abbd8834ba46292e59aeb7.zip | |
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.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/java-ts-mode.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index 23e166ee4c3..9155a7fff25 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el | |||
| @@ -321,7 +321,15 @@ the subtrees." | |||
| 321 | (append "{}():;," electric-indent-chars)) | 321 | (append "{}():;," electric-indent-chars)) |
| 322 | 322 | ||
| 323 | ;; Navigation. | 323 | ;; Navigation. |
| 324 | (setq-local treesit-defun-type-regexp "declaration") | 324 | (setq-local treesit-defun-type-regexp |
| 325 | (regexp-opt '("method_declaration" | ||
| 326 | "class_declaration" | ||
| 327 | "record_declaration" | ||
| 328 | "interface_declaration" | ||
| 329 | "enum_declaration" | ||
| 330 | "import_declaration" | ||
| 331 | "package_declaration" | ||
| 332 | "module_declaration"))) | ||
| 325 | 333 | ||
| 326 | ;; Font-lock. | 334 | ;; Font-lock. |
| 327 | (setq-local treesit-font-lock-settings java-ts-mode--font-lock-settings) | 335 | (setq-local treesit-font-lock-settings java-ts-mode--font-lock-settings) |