Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(preview): update buffer previewer to upstream changes #2150

Merged
merged 1 commit into from
Aug 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(preview): update buffer previewer to upstream changes
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
commit 8498a0758ce06e9e0356937e667deea25c181934
6 changes: 5 additions & 1 deletion lua/telescope/builtin/__files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,12 @@ files.current_buffer_fuzzy_find = function(opts)
return obj
end,
})

-- update to changes on Neovim master, see https://github.com/neovim/neovim/pull/19931
-- TODO(clason): remove when dropping support for Neovim 0.7
local on_nvim_master = vim.fn.has "nvim-0.8" == 1
for id, node in query:iter_captures(root, opts.bufnr, 0, -1) do
local hl = highlighter_query:_get_hl_from_capture(id)
local hl = on_nvim_master and query.captures[id] or highlighter_query:_get_hl_from_capture(id)
if hl and type(hl) ~= "number" then
local row1, col1, row2, col2 = node:range()

Expand Down
5 changes: 0 additions & 5 deletions lua/telescope/builtin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@
--- </code>
---@brief ]]

if 1 ~= vim.fn.has "nvim-0.7.0" then
vim.api.nvim_err_writeln "Telescope.nvim requires at least nvim-0.7.0. See `:h telescope.changelog-1851`"
return
end

local builtin = {}

-- Ref: https://github.com/tjdevries/lazy.nvim
Expand Down