fix: restore cursor to correct position on picker close

This commit is contained in:
James Trew
2024-01-10 23:11:20 +01:00
committed by Simon Hauser
parent 4367e05c06
commit 6a7dd9b399
4 changed files with 40 additions and 27 deletions
+4 -4
View File
@@ -25,9 +25,9 @@
--- - bufnr number (optional): will be interpreted by the default `<cr>` action as open
--- this buffer
--- - lnum number (optional): lnum value which will be interpreted by the default `<cr>`
--- action as a jump to this line
--- action as a jump to this line (1 index)
--- - col number (optional): col value which will be interpreted by the default `<cr>`
--- action as a jump to this column
--- action as a jump to this column (1 index)
---
--- For more information on easier displaying, see |telescope.pickers.entry_display|
---
@@ -694,9 +694,9 @@ function make_entry.gen_from_treesitter(opts)
node_text = node_text,
filename = get_filename(bufnr),
-- need to add one since the previewer substacts one
-- convert lnum/col to 1-index (treesitter uses 0-index)
lnum = start_row + 1,
col = start_col,
col = start_col + 1,
text = node_text,
start = start_row,
finish = end_row,