Skip to content

Commit

Permalink
fix(previewer): treesitter context buffer switch
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Dec 9, 2024
1 parent eca2da2 commit 0063769
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/fzf-lua/previewer/builtin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ end

function TSContext.is_attached(winid)
if not TSContext._setup then return false end
return TSContext._winids[tostring(winid)] ~= nil
return TSContext._winids[tostring(winid)]
end

---@param winid number
Expand Down Expand Up @@ -85,7 +85,7 @@ function TSContext.update(winid, bufnr, opts)
require("treesitter-context.render").open(bufnr, winid, context_ranges, context_lines)
TSContext._winids[tostring(winid)] = bufnr
end
if TSContext.is_attached(winid) then
if TSContext.is_attached(winid) == bufnr then
open()
else
-- HACK: but the entire nvim-treesitter-context is essentially a hack
Expand Down

0 comments on commit 0063769

Please sign in to comment.