diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2022-08-27 15:29:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-27 15:29:36 +0200 |
| commit | b923665e64380e97294af09117e50266c20c71c7 (patch) | |
| tree | e5fc3251a47db1912a0073de968aa4b5d08cca70 /lua | |
| parent | c92f86386f8446e4deaa79941baabaf825683be9 (diff) | |
fix(preview): update buffer previewer to upstream changes (#2150)
https://github.com/neovim/neovim/pull/19931 removed `_get_hl_from_capture(id)` since captures are now implicitly mapped to highlight groups with the same name.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/builtin/__files.lua | 6 | ||||
| -rw-r--r-- | lua/telescope/builtin/init.lua | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/lua/telescope/builtin/__files.lua b/lua/telescope/builtin/__files.lua index df3ccc9..d84c315 100644 --- a/lua/telescope/builtin/__files.lua +++ b/lua/telescope/builtin/__files.lua @@ -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() diff --git a/lua/telescope/builtin/init.lua b/lua/telescope/builtin/init.lua index 3061358..6b27156 100644 --- a/lua/telescope/builtin/init.lua +++ b/lua/telescope/builtin/init.lua @@ -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 |
