Previously, when having window splits, with deleting a buffer involving
deleting a window, getting the jumplist for said deleted window would
result in an invalid jumplist. Trying to iterate over this invalid
jumplist would error out.
When there are split, there's no need to find a valid buffer to switch
the current window to (as the window is deleted). Instead, what's needed
is the updating of telescope's `picker.original_win_id` state. This is
important for when chaining buffer deletes (ie. closing many splits).
Also improve behavior when the "current" buffer is the only valid buffer
-> it will now open an empty buffer (same as when doing `:bdelete`).
* fix(which_key): close window on mouse click action
`nvim_buf_delete` is not allowed during text change or window change.
Window switching with left mouse click was leading to race
condition/error.
* [docgen] Update doc/telescope.txt
skip-checks: true
---------
Co-authored-by: Github Actions <actions@github>
Using anonymous function is throwing warning "No name available for
anonymous functions" when `action_generate.which_key` is used as shown
in the docs.
The previous scrolling implementation (#2687) moved the result selection
by one item at a time, which isn't technically scrolling (ie. moving the
view) and feels quite slow.
Let the neovim builtin scrolling do its thing, so using the scroll wheel
feels like scrolling and is functionally scrolling, too. Scrolling does
not move the selection so after scrolling it typically makes sense to
click. Moving the selection with keyboard takes you back to where you
were. This is in line with typical desktop user interfaces.
* feat(scrolling and mouse support): support scrolling and selecting with the mouse
* fix ascending sorting_strategy mouse clicks
---------
Co-authored-by: James Trew <j.trew10@gmail.com>
* 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>
When filtering is applied, `picker:get_index(picker:get_selection_row())` returns index relative to the filtered entry list rather than the original full results. This causes inaccurate indexing into the `cache_pickers` table.
For some git actions pressing Esc for the dialog of action confirmation
didn't cancel the action. I moved asking for confirmation to a separate
function and a bit changed notifications about canceled action.
Fix the problem I reported in <https://github.com/nvim-telescope/telescope.nvim/issues/1725#issuecomment-1502548033>.
Supporting the abbreviations of the commands to specify the direction makes too
many combinations, so I added only their unabbreviated names.
In addition, make the error message more detailed for users that passes
unsupported command.