Skip to content

Commit b10bca5

Browse files
committed
fix(treesit-auto): force v0.22.0 of C++ grammar (fix syntax highlighting)
1 parent c3030be commit b10bca5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

modules/me-editor.el

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
:hook ((prog-mode conf-mode) . highlight-numbers-mode)
5454
:config
5555
(setq highlight-numbers-generic-regexp (rx (and symbol-start (one-or-more digit)) (optional "." (* digit)) symbol-end))
56-
5756
;; Define the right format for numbers in `dts-mode'
5857
(puthash 'dts-mode
5958
(rx (and symbol-start (or (+ digit) (+ hex-digit) (and "0" (any "xX") (+ hex-digit))) symbol-end))

modules/me-prog.el

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,26 @@
2020
:custom
2121
(treesit-auto-install 'prompt)
2222
:config
23+
;; BUG+FIX: Remove the C++ grammar to force using v0.22.0, newer versions
24+
;; cause problems with syntax highlighting in `c++-ts-mode' buffers.
25+
;; See: https://github.com/abougouffa/minemacs/discussions/135
26+
(cl-callf2 cl-delete-if
27+
(lambda (lang) (eq 'cpp (treesit-auto-recipe-lang lang)))
28+
treesit-auto-recipe-list)
2329
(let ((extra-recipes (list (make-treesit-auto-recipe
2430
:lang 'xml
2531
:ts-mode 'xml-ts-mode
2632
:remap '(nxml-mode xml-mode)
2733
:url "https://github.com/tree-sitter-grammars/tree-sitter-xml"
2834
:source-dir "xml/src"
2935
:ext "\\.xml\\'")
36+
(make-treesit-auto-recipe
37+
:lang 'cpp
38+
:ts-mode 'c++-ts-mode
39+
:remap 'c++-mode
40+
:url "https://github.com/tree-sitter/tree-sitter-cpp"
41+
:revision "v0.22.0"
42+
:ext "\\.cpp\\'")
3043
(make-treesit-auto-recipe
3144
:lang 'llvm
3245
:ts-mode 'llvm-ts-mode

0 commit comments

Comments
 (0)