feat: current buffer fuzzy find improvements (#694)

If you don't want to have a previewer disable it with `:Telescope current_buffer_fuzzy_find previewer=false`
To ignore empty lines do: `:Telescope current_buffer_fuzzy_find skip_empty_lines=true`
This commit is contained in:
August Masquelier
2021-04-04 05:04:06 -06:00
committed by GitHub
parent 0944c4a88f
commit d0cf646f65
2 changed files with 47 additions and 14 deletions

View File

@@ -680,6 +680,38 @@ function make_entry.gen_from_highlights()
end
end
function make_entry.gen_from_buffer_lines(opts)
local displayer = entry_display.create {
separator = '',
items = {
{ width = 5 },
{ remaining = true },
},
}
local make_display = function(entry)
return displayer {
{ entry.lnum, opts.lnum_highlight_group or 'TelescopeResultsSpecialComment' },
entry.line
}
end
return function(entry)
if opts.skip_empty_lines and string.match(entry.line, '^$') then
return
end
return {
valid = true,
ordinal = entry.line,
display = make_display,
filename = entry.filename,
lnum = entry.lnum,
line = entry.line,
}
end
end
function make_entry.gen_from_vimoptions()
local process_one_opt = function(o)
local ok, value_origin