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`.
This commit fixes the following error:
E5108: Error executing lua: Vim:Can't send data to closed stream
stack traceback:
[C]: in function 'chansend'
/lua/telescope/previewers/term_previewer.lua:224: in function '_send_input'
/lua/telescope/previewers/previewer.lua:85: in function 'send_input'
/lua/telescope/previewers/term_previewer.lua:238: in function '_scroll_fn'
/lua/telescope/previewers/previewer.lua:93: in function 'scroll_fn'
/lua/telescope/actions/set.lua:249: in function 'run_replace_or_original'
/lua/telescope/actions/mt.lua:65: in function 'scroll_previewer'
/lua/telescope/actions/init.lua:222: in function 'run_replace_or_original'
This happens when previewers.new_termopen_previewer()'s get_command()
ends without pagination.
The cursor layout uses winline() and wincol() to calculate the cursor
position. Both these functions operate on the currently active window.
The first time the calculations are performed, that happens to be the
window active before showing the Telescope window. However, if the
editor is then resized or the preview window is toggled, the active
window changes. The result is that recalculating the position is then
done using the wrong window, resulting in the Telescope window moving
around in an erratic manner.
To fix this, we have to scope the winline() and wincol() calls to the
original window ID.
The only possibility for having a table with different severities to
pass to `vim.diagnostics.get()` as opts is when setting a range (limit
and bound), so just check for an empty table when a range is set.
* fix(telescope.state.get_existing_prompts): it should only return keys that are numbers
* Table keys not table values should be numbers
* Rename get_existing_prompts to get_existing_prompt_bufnrs and make the impl more efficient
* fix: use nil for the default diagnostics severity
https://github.com/neovim/neovim/pull/24736 has introduced a new syntax
for severity format in `vim.diagnostic.get()`.
Fix#2661
* fix: fallback for 0.9.1
* fix: detect changes only when minor version > 9