Skip to content

Commit

Permalink
fix(previewer): treesitter-context validate bufnr|winid
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Dec 31, 2024
1 parent 7123c77 commit 254f939
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/fzf-lua/previewer/builtin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ function TSContext.update(winid, bufnr, opts)
else
assert(context_lines)
local function open()
require("treesitter-context.render").open(bufnr, winid, context_ranges, context_lines)
TSContext._winids[tostring(winid)] = bufnr
if vim.api.nvim_buf_is_valid(bufnr) and vim.api.nvim_win_is_valid(winid) then
require("treesitter-context.render").open(bufnr, winid, context_ranges, context_lines)
TSContext._winids[tostring(winid)] = bufnr
end
end
if TSContext.is_attached(winid) == bufnr then
open()
Expand Down

0 comments on commit 254f939

Please sign in to comment.