fix(cc): make *.c(c|pp) siblings of *.h(h|pp) files
I backported `find-sibling-file` in198fe82
and included with it some rudimentary `find-sibling-rules` rules for C++ and others. The C++ rule made *.h(h|pp) files the siblings of *.c(c|pp) files, but not vice versa, so users couldn't jump back to the source file with `find-sibling-file`; a second rule is necessary. These may be combinable, considering `find-sibling-file` deletes the current buffer's filename from the list of candidates... Fix: #7795 Ref:198fe82b6d
This commit is contained in:
parent
38a3adcf0e
commit
19e27764ea
1 changed files with 2 additions and 1 deletions
|
@ -78,7 +78,8 @@ This is ignored by ccls.")
|
|||
:return "return"
|
||||
:yield "#require")
|
||||
|
||||
(add-to-list 'find-sibling-rules '("/\\([^/]+\\)\\.c\\(c\\|pp\\)\\'" "\\1.\\(h\\|hh\\|hpp\\)"))
|
||||
(add-to-list 'find-sibling-rules '("/\\([^/]+\\)\\.c\\(c\\|pp\\)?\\'" "\\1.h\\(h\\|pp\\)?\\'"))
|
||||
(add-to-list 'find-sibling-rules '("/\\([^/]+\\)\\.h\\(h\\|pp\\)?\\'" "\\1.c\\(c\\|pp\\)?\\'"))
|
||||
|
||||
(when (modulep! +tree-sitter)
|
||||
(add-hook! '(c-mode-local-vars-hook
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue