fix(cc): remove executable-find formatter check

This commit is contained in:
Ellis Kenyő 2022-11-17 17:04:50 +00:00 committed by Ellis Kenyo
parent 26819c33f3
commit cc9bda36c2
No known key found for this signature in database
GPG key ID: 298BE5D997EBAA02

View file

@ -48,18 +48,17 @@ This is ignored by ccls.")
(set-docsets! 'c-mode "C") (set-docsets! 'c-mode "C")
(set-docsets! 'c++-mode "C++" "Boost") (set-docsets! 'c++-mode "C++" "Boost")
(set-electric! '(c-mode c++-mode objc-mode java-mode) :chars '(?\n ?\} ?\{)) (set-electric! '(c-mode c++-mode objc-mode java-mode) :chars '(?\n ?\} ?\{))
(when (executable-find "clang-format") (set-formatter!
(set-formatter! 'clang-format
'clang-format '("clang-format"
'("clang-format" "-assume-filename"
"-assume-filename" (or (buffer-file-name)
(or (buffer-file-name) (cdr (assoc major-mode
(cdr (assoc major-mode '((c-mode . ".c")
'((c-mode . ".c") (c++-mode . ".cpp")
(c++-mode . ".cpp") (cuda-mode . ".cu")
(cuda-mode . ".cu") (protobuf-mode . ".proto"))))))
(protobuf-mode . ".proto")))))) :modes '(c-mode c++-mode protobuf-mode cuda-mode))
:modes '(c-mode c++-mode protobuf-mode cuda-mode)))
(set-rotate-patterns! 'c++-mode (set-rotate-patterns! 'c++-mode
:symbols '(("public" "protected" "private") :symbols '(("public" "protected" "private")
("class" "struct"))) ("class" "struct")))