diff options
author | Micah Halter <micah@mehalter.com> | 2023-07-24 10:26:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-24 07:26:38 -0700 |
commit | 48085e40bb0e4435ddb2eb7f14b4531b943e0c89 (patch) | |
tree | d3822860183441bf78db167429c6498523638a21 | |
parent | 78b56b21b4a80fcc7deaf131e49536e23c73c6d8 (diff) | |
download | rneovim-48085e40bb0e4435ddb2eb7f14b4531b943e0c89.tar.gz rneovim-48085e40bb0e4435ddb2eb7f14b4531b943e0c89.tar.bz2 rneovim-48085e40bb0e4435ddb2eb7f14b4531b943e0c89.zip |
fix(treesitter): stop() should treat 0 as current buffer #24450
-rw-r--r-- | runtime/lua/vim/treesitter.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua index 8bd85d3734..04420c81e3 100644 --- a/runtime/lua/vim/treesitter.lua +++ b/runtime/lua/vim/treesitter.lua @@ -462,7 +462,7 @@ end --- ---@param bufnr (integer|nil) Buffer to stop highlighting (default: current buffer) function M.stop(bufnr) - bufnr = bufnr or api.nvim_get_current_buf() + bufnr = (bufnr and bufnr ~= 0) and bufnr or api.nvim_get_current_buf() if M.highlighter.active[bufnr] then M.highlighter.active[bufnr]:destroy() |