mirror of
https://github.com/zoriya/telescope.nvim.git
synced 2026-08-16 02:45:09 +00:00
feat(previewer): show unwritten buffer previewers for some pickers
Use actual buffer contents for buffer previewers for some pickers (buffers, treesitter, current_buffer_fuzzy_find, for starters). Not to be confused with reusing buffers for preview buffers. This lets users view previews of buffers with unwritten changes. For treesitter and current_buffer_fuzzy_find, not showing actual buffer content is arguably a bug considering the finder operates over the buffer (written or not). So there are instances where you can search over unwritten content in the buffer only to see an outdated, written only content in the preview.
This commit is contained in:
@@ -708,6 +708,7 @@ function make_entry.gen_from_treesitter(opts)
|
||||
node_text = node_text,
|
||||
|
||||
filename = get_filename(bufnr),
|
||||
bufnr = opts.bufnr,
|
||||
-- need to add one since the previewer substacts one
|
||||
lnum = start_row + 1,
|
||||
col = start_col,
|
||||
@@ -971,6 +972,7 @@ function make_entry.gen_from_buffer_lines(opts)
|
||||
ordinal = entry.text,
|
||||
display = make_display,
|
||||
filename = entry.filename,
|
||||
bufnr = opts.bufnr,
|
||||
lnum = entry.lnum,
|
||||
text = entry.text,
|
||||
}, opts)
|
||||
|
||||
Reference in New Issue
Block a user