diff options
Diffstat (limited to 'runtime/lua')
-rw-r--r-- | runtime/lua/vim/_meta/options.lua | 4 | ||||
-rw-r--r-- | runtime/lua/vim/treesitter/highlighter.lua | 10 |
2 files changed, 5 insertions, 9 deletions
diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index e63c5bb972..6b7cfa79b3 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -1049,11 +1049,11 @@ vim.bo.cfu = vim.bo.completefunc --- completion in the preview window. Only works in --- combination with "menu" or "menuone". --- ---- noinsert Do not insert any text for a match until the user selects +--- noinsert Do not insert any text for a match until the user selects --- a match from the menu. Only works in combination with --- "menu" or "menuone". No effect if "longest" is present. --- ---- noselect Do not select a match in the menu, force the user to +--- noselect Do not select a match in the menu, force the user to --- select one from the menu. Only works in combination with --- "menu" or "menuone". --- diff --git a/runtime/lua/vim/treesitter/highlighter.lua b/runtime/lua/vim/treesitter/highlighter.lua index 17543bc787..b2cc334bdc 100644 --- a/runtime/lua/vim/treesitter/highlighter.lua +++ b/runtime/lua/vim/treesitter/highlighter.lua @@ -163,6 +163,8 @@ end ---@param erow integer exclusive ---@private function TSHighlighter:prepare_highlight_states(srow, erow) + self._highlight_states = {} + self.tree:for_each_tree(function(tstree, tree) if not tstree then return @@ -202,11 +204,6 @@ function TSHighlighter:for_each_highlight_state(fn) end end ----@private -function TSHighlighter:reset_highlight_state() - self._highlight_states = {} -end - ---@package ---@param start_row integer ---@param new_end integer @@ -327,7 +324,7 @@ function TSHighlighter._on_spell_nav(_, _, buf, srow, _, erow, _) return end - self:reset_highlight_state() + self:prepare_highlight_states(srow, erow) for row = srow, erow do on_line_impl(self, buf, row, true) @@ -345,7 +342,6 @@ function TSHighlighter._on_win(_, _win, buf, topline, botline) return false end self.tree:parse({ topline, botline + 1 }) - self:reset_highlight_state() self:prepare_highlight_states(topline, botline + 1) self.redraw_count = self.redraw_count + 1 return true |