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