mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-07 12:47:30 -05:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user