From ccbb7f56384921a81813f0f9ebc85cdba0b7c255 Mon Sep 17 00:00:00 2001 From: anott03 Date: Mon, 25 Jan 2021 13:20:01 -0500 Subject: fix: move to actions.select as default action (#465) --- lua/telescope/actions/init.lua | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'lua/telescope/actions/init.lua') diff --git a/lua/telescope/actions/init.lua b/lua/telescope/actions/init.lua index 50c7f37..34cfede 100644 --- a/lua/telescope/actions/init.lua +++ b/lua/telescope/actions/init.lua @@ -66,7 +66,7 @@ function actions.preview_scrolling_down(prompt_bufnr) end -- TODO: It seems sometimes we get bad styling. -function actions._goto_file_selection(prompt_bufnr, command) +function actions._select(prompt_bufnr, command) local entry = actions.get_selected_entry(prompt_bufnr) if not entry then @@ -144,22 +144,29 @@ function actions.center(_) vim.cmd(':normal! zz') end -function actions.goto_file_selection_edit(prompt_bufnr) - actions._goto_file_selection(prompt_bufnr, "edit") +function actions.select(prompt_bufnr) + actions._select(prompt_bufnr, "edit") end -function actions.goto_file_selection_split(prompt_bufnr) - actions._goto_file_selection(prompt_bufnr, "new") +function actions.hselect(prompt_bufnr) + actions._select(prompt_bufnr, "new") end -function actions.goto_file_selection_vsplit(prompt_bufnr) - actions._goto_file_selection(prompt_bufnr, "vnew") +function actions.vselect(prompt_bufnr) + actions._select(prompt_bufnr, "vnew") end -function actions.goto_file_selection_tabedit(prompt_bufnr) - actions._goto_file_selection(prompt_bufnr, "tabedit") +function actions.tabselect(prompt_bufnr) + actions._select(prompt_bufnr, "tabedit") end +-- aliases +actions._goto_file_selection = actions._select +actions.goto_file_selection_edit = actions.select +actions.goto_file_selection_split = actions.hselect +actions.goto_file_selection_vsplit = actions.vselect +actions.goto_file_selection_tabedit = actions.tabselect + function actions.close_pum(_) if 0 ~= vim.fn.pumvisible() then vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, true, true), 'n', true) -- cgit v1.2.3