Skip to content

Commit

Permalink
fix(builtin.current_buffer_fuzzy_find): manually go through highlight…
Browse files Browse the repository at this point in the history
…ed chars to pick smallest one (#2922)
  • Loading branch information
antonk52 committed Feb 15, 2024
1 parent fac5da8 commit 45d61cc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lua/telescope/builtin/__files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,18 @@ files.current_buffer_fuzzy_find = function(opts)
local current_picker = action_state.get_current_picker(prompt_bufnr)
local searched_for = require("telescope.actions.state").get_current_line()
local highlighted = current_picker.sorter:highlighter(searched_for, selection.ordinal)
local column = math.min(unpack(highlighted) or 1) - 1
highlighted = highlighted or {}
local column = highlighted[1]
for _, v in ipairs(highlighted) do
if v < column then
column = v
end
end
if column then
column = column - 1
else
column = 0
end

actions.close(prompt_bufnr)
vim.schedule(function()
Expand Down

0 comments on commit 45d61cc

Please sign in to comment.