aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-09-06 10:10:01 +0200
committerGitHub <noreply@github.com>2022-09-06 10:10:01 +0200
commit5b8d6e0b3200c5cb9d98cbdb4ed0afe2b4edd38d (patch)
tree23aac48c4aff31236341260942ceeb7b42fc90ab /runtime/syntax
parent4bf005e9fdfb57397475b2663a3651faa83886ff (diff)
parent0822896efcf0da7002e323369fdc1e4a15ad1d57 (diff)
downloadrneovim-5b8d6e0b3200c5cb9d98cbdb4ed0afe2b4edd38d.tar.gz
rneovim-5b8d6e0b3200c5cb9d98cbdb4ed0afe2b4edd38d.tar.bz2
rneovim-5b8d6e0b3200c5cb9d98cbdb4ed0afe2b4edd38d.zip
Merge pull request #15391 from vigoux/ts-lua-builtin
feat(treesitter): highlighting for core languages, enabled for Lua
Diffstat (limited to 'runtime/syntax')
-rw-r--r--runtime/syntax/syntax.vim6
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/syntax/syntax.vim b/runtime/syntax/syntax.vim
index 55a2ee6d71..5ec99c7e05 100644
--- a/runtime/syntax/syntax.vim
+++ b/runtime/syntax/syntax.vim
@@ -27,13 +27,13 @@ else
endif
" Set up the connection between FileType and Syntax autocommands.
-" This makes the syntax automatically set when the file type is detected.
+" This makes the syntax automatically set when the file type is detected
+" unless treesitter highlighting is enabled.
" Avoid an error when 'verbose' is set and <amatch> expansion fails.
augroup syntaxset
- au! FileType * 0verbose exe "set syntax=" . expand("<amatch>")
+ au! FileType * if !exists('b:ts_highlight') | 0verbose exe "set syntax=" . expand("<amatch>") | endif
augroup END
-
" Execute the syntax autocommands for the each buffer.
" If the filetype wasn't detected yet, do that now.
" Always do the syntaxset autocommands, for buffers where the 'filetype'