There's a limitation with extmark's `right_align` virtual text and how
it handles side scrolling. This causes text entered to be hidden behind
the virtual text rather than begin the side scroll.
An issue is opened upstream https://github.com/neovim/neovim/issues/27540
But this could take a while before it's fixed as it's considered
`complexity:high`.
This PR adds a temporary workaround of just hiding the status text if the
prompt is long enough to interfere with it.
Previous implementation of placing the cursor on the first column of the
highlight failed to take into account that the highlighter can return
more than one data structure.
* feat(builtin.current_buffer_fuzzy_find): jump to first matched char
* use highlighter to detect column to jump to
* replace default select
* handle non 0 based column index
* handle no highlight scenario
---------
Co-authored-by: James Trew <j.trew10@gmail.com>
Fixes couple of regressions from #2791 when no line number info is given
in the prompt (eg. `file.txt` rather than `file.txt:10`).
Both issues stemming from the fact that when no line number info is
given, the `entry.lnum` was set to `0`. `entry.lnum` is 1-index.
- Sending results to quickfix would send faulty results (closes#2864)
- Will no open the file on the correct (previous) line number
For this, setting the lnum to 1 is still undesirable since this
overwrites the lnum priority handling in the `select` action.
This implements a experimental interface for allowing prompts like this `file.txt:3:4`. It is already enabled on default for `find_files` and `git_files`.
Be wary of breaking changes for the interface if you plan to manually enable it.
Previously, using `string.find`, certain characters were taken as regex
special characters leading to bad matches.
New approach takes bufname truncated to the length of cwd and compares
the two strings.
closes#2843
Previously, bad partial matches between cwd and target buffer path would
result in non-cwd buffers showing up in the picker despite using
`only_cwd=true`.
eg.
cwd = `/foo/bar`
target buffer = `foo/bar1/baz.txt`
The target buffer starts with the cwd path.
This is fixed by appending a path separator before comparing/matching:
eg.
cwd = `/foo/bar/`
target buffer = `foo/bar1/baz.txt`
* Add autocmd to make `which_key` window close on prompt exit
Currently `actions.which_key` supports a `close_with_action` option
(default true). When this is set, the `which_key` window will close
after any Telescope action is triggered. This makes sense. However, when
it is false, the `which_key` window remains open even after Telescope
closes. This seems like a bug.
This PR fixes this by setting an autocommand when `close_with_action` is
false to close on prompt exit.
* [docgen] Update doc/telescope.txt
skip-checks: true
* Add autocmd to make `which_key` window close on prompt exit
Currently `actions.which_key` supports a `close_with_action` option
(default true). When this is set, the `which_key` window will close
after any Telescope action is triggered. This makes sense. However, when
it is false, the `which_key` window remains open even after Telescope
closes. This seems like a bug.
This PR fixes this by setting an autocommand when `close_with_action` is
false to close on prompt exit.
---------
Co-authored-by: Github Actions <actions@github>
Previously, `git_status` with a prompt that has zero matches closes the
picker.
Only automatically close the picker if working tree is completely clean.
If working tree is not clean, and a prompt is given but no matches are
found, keep the picker open. This behavior is consistent with other
pickers where lack of matches doesn't result in the picker closing.
closes#2815
* feat(lsp_definitions): adding `tab drop` as `jump_type`
* feat(lsp-jump-types): `tab drop` for LSP features
Now, you're able to use `tab drop` as `jump_type` for these LSP
features: references, type definitions, definitions an implementations.
* fix(docs): reordering `tab drop` option
* feat: generate docs
* fix: nil problem with `vim.uri_to_fname`
* fix: removing warning about `file_uri` variable not being used
---------
Co-authored-by: Simon Hauser <simon.hauser@helsinki-systems.de>
With this change we will check if the provided buffer number is valid,
before querying its `buftype` option. This is necessary, because
currently we would fail with:
```
Error executing vim.schedule lua callback:
...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:473:
Invalid buffer id: X
```
error, if we try to resume a jumplist picker after doing `:bwipeout`.