Skip to content

Commit 8b9438d

Browse files
committed
chore(toggles): use nvim_get_current_buf rahter than nvim_win_get_buf(0)
1 parent 5ac3b0a commit 8b9438d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lua/astrocore/toggles.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ end
186186
---@param silent? boolean if true then do not send a notification
187187
function M.buffer_syntax(bufnr, silent)
188188
-- HACK: this should just be `bufnr = bufnr or 0` but it looks like `vim.treesitter.stop` has a bug with `0` being current
189-
bufnr = (bufnr and bufnr ~= 0) and bufnr or vim.api.nvim_win_get_buf(0)
189+
bufnr = (bufnr and bufnr ~= 0) and bufnr or vim.api.nvim_get_current_buf()
190190
local treesitter = require "astrocore.treesitter"
191191
local astrolsp_avail, lsp_toggle = pcall(require, "astrolsp.toggles")
192192
local semantic_tokens_enabled = vim.b[bufnr].semantic_tokens

0 commit comments

Comments
 (0)