Skip to content

Commit

Permalink
fix(preview): update buffer previewer to upstream changes
Browse files Browse the repository at this point in the history
neovim/neovim#19931 removed `_get_hl_from_capture(id)` since captures are now implicitly mapped to highlight groups with the same name.
  • Loading branch information
clason committed Aug 27, 2022
1 parent c92f863 commit 7598e9d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lua/telescope/builtin/__files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,14 @@ files.current_buffer_fuzzy_find = function(opts)
end,
})
for id, node in query:iter_captures(root, opts.bufnr, 0, -1) do
local hl = highlighter_query:_get_hl_from_capture(id)
local hl
-- update to changes on Neovim master, see https://github.com/neovim/neovim/pull/19931
-- TODO(clason): remove when dropping support for Neovim 0.7
if vim.fn.has "nvim-0.8" then
hl = query.captures[id]
else
hl = highlighter_query:_get_hl_from_capture(id)
end
if hl and type(hl) ~= "number" then
local row1, col1, row2, col2 = node:range()

Expand Down

0 comments on commit 7598e9d

Please sign in to comment.