Skip to content

Commit

Permalink
fix(sources-treesitter): active ts parser ignore if highlight disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
bekaboo committed Nov 24, 2023
1 parent d308748 commit c88c4ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/dropbar/sources/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ end
---@param cursor integer[] cursor position
---@return dropbar_symbol_t[] symbols winbar symbols
local function get_symbols(buf, win, cursor)
if not vim.treesitter.highlighter.active[buf] then
local ts_ok = pcall(vim.treesitter.get_parser, buf or 0, vim.b[buf].ft)
if not ts_ok then
return {}
end

Expand Down

0 comments on commit c88c4ff

Please sign in to comment.