diff options
| author | tami5 <65782666+tami5@users.noreply.github.com> | 2020-12-01 14:03:14 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-01 14:03:14 +0300 |
| commit | f3caae5ddad10eed8209cd3dcdd020620d0b9f7f (patch) | |
| tree | aff886aeeebcd785d3de37e89f822ce4884fb691 /lua | |
| parent | 07ce3c341a8c2824c44fcf50841917debf215058 (diff) | |
fix: builtin runner insert issue (#266)
closes #262 , adds new parameter to action.close. Users know can have more control over the mode after action.close is called.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/actions/init.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lua/telescope/actions/init.lua b/lua/telescope/actions/init.lua index 4b152b6..15a3602 100644 --- a/lua/telescope/actions/init.lua +++ b/lua/telescope/actions/init.lua @@ -151,7 +151,7 @@ function actions.close_pum(_) end end -function actions.close(prompt_bufnr) +function actions.close(prompt_bufnr, keepinsert) local picker = actions.get_current_picker(prompt_bufnr) local prompt_win = state.get_status(prompt_bufnr).prompt_win local original_win_id = picker.original_win_id @@ -161,7 +161,9 @@ function actions.close(prompt_bufnr) end actions.close_pum(prompt_bufnr) - vim.cmd [[stopinsert]] + if not keepinsert then + vim.cmd [[stopinsert]] + end vim.api.nvim_win_close(prompt_win, true) @@ -219,8 +221,7 @@ end actions.run_builtin = function(prompt_bufnr) local entry = actions.get_selected_entry(prompt_bufnr) - actions.close(prompt_bufnr) - vim.cmd [[startinsert]] + actions.close(prompt_bufnr, "keepinsert") require('telescope.builtin')[entry.text]() end |
