Fix enums and unions appearing as structs in c-ts-base-mode's imenu
* lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Separate enums and unions out from structs.
This commit is contained in:
parent
ecdfd584a5
commit
1de513a29f
1 changed files with 3 additions and 3 deletions
|
@ -930,9 +930,9 @@ the semicolon. This function skips the semicolon."
|
|||
;; Imenu.
|
||||
(setq-local treesit-simple-imenu-settings
|
||||
(let ((pred #'c-ts-mode--defun-valid-p))
|
||||
`(("Struct" ,(rx bos (or "struct" "enum" "union")
|
||||
"_specifier" eos)
|
||||
,pred nil)
|
||||
`(("Enum" "\\`enum_specifier\\'" ,pred nil)
|
||||
("Struct" "\\`struct_specifier\\'" ,pred nil)
|
||||
("Union" "\\`union_specifier\\'" ,pred nil)
|
||||
("Variable" ,(rx bos "declaration" eos) ,pred nil)
|
||||
("Function" "\\`function_definition\\'" ,pred nil)
|
||||
("Class" ,(rx bos (or "class_specifier"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue