feat: Action improvements (#472)
* feat: replace_map * feat: Add action_set and action_state * fix: Move all actions.get_ to action_state.get_ * fix: replace all internal references of _goto_file_selection_edit * feat: add some docs * fix: lint * feat: actions.select * remove mentions and usage of goto_file_selection APIs * feat: special case attach_mappings to be overridable and defaultable * Having goto_file_selection mappings will cause a error as well as replacing deprecated goto_file_selection methodes For config and replacing use this instead: - actions.select_default - actions.select_horizonal - actions.select_vertical - actions.select_tab Only replacing: - actions.set.edit -- for replacing all select functions * adds actions.state.select_key_to_edit_key Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local actions = require('telescope.actions')
|
||||
local action_state = require('telescope.actions.state')
|
||||
local action_set = require('telescope.actions.set')
|
||||
local finders = require('telescope.finders')
|
||||
local make_entry = require('telescope.make_entry')
|
||||
local pickers = require('telescope.pickers')
|
||||
@@ -256,9 +257,9 @@ files.current_buffer_fuzzy_find = function(opts)
|
||||
},
|
||||
sorter = conf.generic_sorter(opts),
|
||||
attach_mappings = function()
|
||||
actions._goto_file_selection:enhance {
|
||||
action_set.select:enhance {
|
||||
post = function()
|
||||
local selection = actions.get_selected_entry()
|
||||
local selection = action_state.get_selected_entry()
|
||||
vim.api.nvim_win_set_cursor(0, {selection.lnum, 0})
|
||||
end,
|
||||
}
|
||||
@@ -292,9 +293,9 @@ files.tags = function(opts)
|
||||
previewer = previewers.ctags.new(opts),
|
||||
sorter = conf.generic_sorter(opts),
|
||||
attach_mappings = function()
|
||||
actions._goto_file_selection:enhance {
|
||||
action_set.select:enhance {
|
||||
post = function()
|
||||
local selection = actions.get_selected_entry()
|
||||
local selection = action_set.get_selected_entry()
|
||||
|
||||
if selection.scode then
|
||||
local scode = string.gsub(selection.scode, '[$]$', '')
|
||||
|
||||
Reference in New Issue
Block a user