diff options
Diffstat (limited to 'runtime/lua')
-rw-r--r-- | runtime/lua/vim/_editor.lua | 4 | ||||
-rw-r--r-- | runtime/lua/vim/treesitter/highlighter.lua | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua index 453aa6ac81..f7dcc3a81b 100644 --- a/runtime/lua/vim/_editor.lua +++ b/runtime/lua/vim/_editor.lua @@ -408,7 +408,9 @@ function vim.defer_fn(fn, timeout) timeout, 0, vim.schedule_wrap(function() - timer:close() + if not timer:is_closing() then + timer:close() + end fn() end) diff --git a/runtime/lua/vim/treesitter/highlighter.lua b/runtime/lua/vim/treesitter/highlighter.lua index 453fed0576..d3da300e96 100644 --- a/runtime/lua/vim/treesitter/highlighter.lua +++ b/runtime/lua/vim/treesitter/highlighter.lua @@ -279,7 +279,7 @@ local function on_line_impl(self, buf, line) return end - if state.iter == nil then + if state.iter == nil or state.next_row < line then state.iter = highlighter_query:query():iter_captures(root_node, self.bufnr, line, root_end_row + 1) end |