diff options
Diffstat (limited to 'lisp/progmodes/c-ts-mode.el')
| -rw-r--r-- | lisp/progmodes/c-ts-mode.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index c8120d5752c..d08615446a1 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -1475,7 +1475,9 @@ in your init files, or customize `treesit-enabled-modes'." :group 'c :after-hook (c-ts-mode-set-modeline) - (when (treesit-ensure-installed 'c) + ;; `treesit-ready-p' also checks for buffer size. + (when (and (treesit-ensure-installed 'c) + (treesit-ready-p 'c)) ;; Create an "for-each" parser, see `c-ts-mode--emacs-set-ranges' ;; for more. (when c-ts-mode-emacs-sources-support @@ -1554,7 +1556,9 @@ recommended to enable `electric-pair-mode' with this mode." :group 'c++ :after-hook (c-ts-mode-set-modeline) - (when (treesit-ensure-installed 'cpp) + ;; `treesit-ready-p' also checks for buffer size. + (when (and (treesit-ensure-installed 'cpp) + (treesit-ready-p 'cpp)) (let ((primary-parser (treesit-parser-create 'cpp))) ;; Syntax. |
