lang/cc: fix rtags in other c*-mode derived modes; fix cleanup hook
Also fixed rtags cleanup in doom-cleanup-hook to only kill the server if there are no more C/C++ buffers open.
This commit is contained in:
parent
cde3a3ee78
commit
28adf5825f
2 changed files with 21 additions and 8 deletions
|
@ -88,3 +88,14 @@ compilation dbs."
|
|||
nconc (list "-I" path)))
|
||||
(doom-project-root)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +cc|init-rtags ()
|
||||
"Start an rtags server in c-mode and c++-mode buffers."
|
||||
(when (memq major-mode '(c-mode c++-mode))
|
||||
(rtags-start-process-unless-running)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +cc|cleanup-rtags ()
|
||||
"Kill rtags server(s) if there are no C/C++ buffers open."
|
||||
(unless (doom-buffers-in-mode '(c-mode c++-mode) (buffer-list))
|
||||
(rtags-cancel-process)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue