aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter/highlighter.lua
diff options
context:
space:
mode:
authorLewis Russell <me@lewisr.dev>2022-09-06 19:22:05 +0100
committerGitHub <noreply@github.com>2022-09-06 19:22:05 +0100
commit707edfc9e6a1745f268d1a9184183da521dc86b8 (patch)
tree79695820b20ba9d3d3bd44fa83cce0116279c4da /runtime/lua/vim/treesitter/highlighter.lua
parentaaa54a8b3e6799f16fc777f4d7f1d1c4f132f364 (diff)
downloadrneovim-707edfc9e6a1745f268d1a9184183da521dc86b8.tar.gz
rneovim-707edfc9e6a1745f268d1a9184183da521dc86b8.tar.bz2
rneovim-707edfc9e6a1745f268d1a9184183da521dc86b8.zip
fix(ts): do not clobber spelloptions (#20095)
Diffstat (limited to 'runtime/lua/vim/treesitter/highlighter.lua')
-rw-r--r--runtime/lua/vim/treesitter/highlighter.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/lua/vim/treesitter/highlighter.lua b/runtime/lua/vim/treesitter/highlighter.lua
index 9e95af98db..1e625eddb8 100644
--- a/runtime/lua/vim/treesitter/highlighter.lua
+++ b/runtime/lua/vim/treesitter/highlighter.lua
@@ -86,7 +86,7 @@ function TSHighlighter.new(tree, opts)
end
end
- a.nvim_buf_set_option(self.bufnr, 'syntax', '')
+ vim.bo[self.bufnr].syntax = ''
TSHighlighter.active[self.bufnr] = self
@@ -95,9 +95,12 @@ function TSHighlighter.new(tree, opts)
-- syntax FileType autocmds. Later on we should integrate with the
-- `:syntax` and `set syntax=...` machinery properly.
if vim.g.syntax_on ~= 1 then
- vim.api.nvim_command('runtime! syntax/synload.vim')
+ vim.cmd.runtime({ 'syntax/synload.vim', bang = true })
end
- vim.bo[self.bufnr].spelloptions = 'noplainbuffer'
+
+ a.nvim_buf_call(self.bufnr, function()
+ vim.opt_local.spelloptions:append('noplainbuffer')
+ end)
self.tree:parse()