diff options
| author | fdschmidt93 <39233597+fdschmidt93@users.noreply.github.com> | 2022-04-27 12:33:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-27 12:33:49 +0200 |
| commit | 4449f709c36503e65e40d9e61bf742ef861c7269 (patch) | |
| tree | 7da54c901df8dbfd04149358b38f63ee6221d8f9 /lua/telescope/pickers.lua | |
| parent | 6a54433038ce6d37e506ff9102ad7fcca121d58a (diff) | |
fix(finder): don't trigger twice w/ inital_mode="insert" (#1886)
Diffstat (limited to 'lua/telescope/pickers.lua')
| -rw-r--r-- | lua/telescope/pickers.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua index fd3558a..6e8b36b 100644 --- a/lua/telescope/pickers.lua +++ b/lua/telescope/pickers.lua @@ -438,8 +438,9 @@ function Picker:find() vim.schedule(function() -- startinsert! did not reliable do `A` no idea why, i even looked at the source code -- Example: live_grep -> type something -> quit -> Telescope pickers -> resume -> cursor of by one - if vim.fn.mode() ~= "i" then - vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<ESC>A", true, false, true), "n", true) + local mode = vim.fn.mode() + if mode ~= "i" then + a.nvim_input(mode ~= "n" and "<ESC>A" or "A") end end) elseif self.initial_mode ~= "normal" then |
