Revert "fix: preserve queued keys at picker launch (#2274)" (#2619)

* Revert "fix: preserve queued keys at picker launch (#2274) (#2618)"

This reverts commit f78d956901.

* [docgen] Update doc/telescope.txt
skip-checks: true

---------

Co-authored-by: Github Actions <actions@github>
This commit is contained in:
James Trew
2023-07-22 19:23:22 -04:00
committed by GitHub
parent e7e6492a2d
commit 1228f3b15c
2 changed files with 14 additions and 13 deletions

View File

@@ -1054,8 +1054,8 @@ builtin.git_bcommits({opts}) *telescope.builtin.git_bcommits()*
builtin.git_bcommits_range({opts}) *telescope.builtin.git_bcommits_range()* builtin.git_bcommits_range({opts}) *telescope.builtin.git_bcommits_range()*
Lists commits for a range of lines in the current buffer with diff preview Lists commits for a range of lines in the current buffer with diff preview
In visual mode, lists commits for the selected lines In visual mode, lists commits for the selected lines With operator mode
With operator mode enabled, lists commits inside the text object/motion enabled, lists commits inside the text object/motion
- Default keymaps or your overridden `select_` keys: - Default keymaps or your overridden `select_` keys:
- `<cr>`: checks out the currently selected commit - `<cr>`: checks out the currently selected commit
- `<c-v>`: opens a diff in a vertical split - `<c-v>`: opens a diff in a vertical split
@@ -1075,13 +1075,14 @@ builtin.git_bcommits_range({opts}) *telescope.builtin.git_bcommits_range()*
{git_command} (table) command that will be executed. the last {git_command} (table) command that will be executed. the last
element must be "-L". element must be "-L".
{"git","log","--pretty=oneline","--abbrev-commit","--no-patch","-L"} {"git","log","--pretty=oneline","--abbrev-commit","--no-patch","-L"}
{from} (number) the first line number in the range {from} (number) the first line number in the range (default:
(default: current line) current line)
{to} (number) the last line number in the range {to} (number) the last line number in the range (default:
(default: the value of `from`) the value of `from`)
{operator} (boolean) select lines in operator-pending mode {operator} (boolean) select lines in operator-pending mode
(default: false) (default: false)
builtin.git_branches({opts}) *telescope.builtin.git_branches()* builtin.git_branches({opts}) *telescope.builtin.git_branches()*
List branches for current directory, with output from `git log --oneline` List branches for current directory, with output from `git log --oneline`
shown in the preview window shown in the preview window

View File

@@ -430,16 +430,16 @@ function Picker:find()
end end
if vim.tbl_contains({ "insert", "normal" }, self.initial_mode) then if vim.tbl_contains({ "insert", "normal" }, self.initial_mode) then
-- Note that `feedkeys()` should not be used to change modes, as local mode = vim.fn.mode()
-- the user may have queued keystrokes that would be processed first, local keys
-- interfering with desired operation.
if self.initial_mode == "normal" then if self.initial_mode == "normal" then
-- Ensure cursor is at always at end of prompt w/o default_text -- n: A<ESC> makes sure cursor is at always at end of prompt w/o default_text
vim.cmd "normal! $" keys = mode ~= "n" and "<ESC>A<ESC>" or "A<ESC>"
else else
-- always fully retrigger insert mode: required for going from one picker to next -- always fully retrigger insert mode: required for going from one picker to next
vim.cmd "startinsert!" keys = mode ~= "n" and "<ESC>A" or "A"
end end
a.nvim_feedkeys(a.nvim_replace_termcodes(keys, true, false, true), "n", true)
else else
utils.notify( utils.notify(
"pickers.find", "pickers.find",