diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2021-03-17 16:51:43 +0100 |
|---|---|---|
| committer | Stephan Seitz <stephan.lauf@yahoo.de> | 2021-03-18 12:03:37 +0100 |
| commit | 7dacd66aecee54d8d737b5594acd3a882a61599c (patch) | |
| tree | 51bc10c516e1a5ea29c3bf0bc888c84351be0f4c /lua | |
| parent | feat: Allow to configure to use syntax and tree-sitter together (diff) | |
| download | nvim-treesitter-7dacd66aecee54d8d737b5594acd3a882a61599c.tar nvim-treesitter-7dacd66aecee54d8d737b5594acd3a882a61599c.tar.gz nvim-treesitter-7dacd66aecee54d8d737b5594acd3a882a61599c.tar.bz2 nvim-treesitter-7dacd66aecee54d8d737b5594acd3a882a61599c.tar.lz nvim-treesitter-7dacd66aecee54d8d737b5594acd3a882a61599c.tar.xz nvim-treesitter-7dacd66aecee54d8d737b5594acd3a882a61599c.tar.zst nvim-treesitter-7dacd66aecee54d8d737b5594acd3a882a61599c.zip | |
feat: Allow tables for additional_vim_regex_highlighting
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-treesitter/highlight.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/highlight.lua b/lua/nvim-treesitter/highlight.lua index f2ed0d31e..6f9208eeb 100644 --- a/lua/nvim-treesitter/highlight.lua +++ b/lua/nvim-treesitter/highlight.lua @@ -104,7 +104,9 @@ function M.attach(bufnr, lang) end ts.highlighter.new(parser, {}) - if config.additional_vim_regex_highlighting then + + local is_table = type(config.additional_vim_regex_highlighting) == 'table' + if config.additional_vim_regex_highlighting and (not is_table or config.additional_vim_regex_highlighting[lang]) then api.nvim_buf_set_option(bufnr, 'syntax', 'ON') end end |
