summaryrefslogtreecommitdiff
path: root/lua/telescope/actions/set.lua
diff options
context:
space:
mode:
authorSimon Hauser <Simon-Hauser@outlook.de>2021-07-09 20:45:29 +0200
committerGitHub <noreply@github.com>2021-07-09 20:45:29 +0200
commit36996056272a7174868367acf1043cead333d115 (patch)
treecd5a33dac60c9c5ee6ae17b6be2f51fa44b52562 /lua/telescope/actions/set.lua
parent385020eb232b48a5a3583f531ff27266fb06eec4 (diff)
feat: cycle prompt history (#521)
history is enabled on default but cycle_history_next and cycle_history_prev is not mapped yet Example: require('telescope').setup { defaults = { mappings = { i = { ["<C-Down>"] = require('telescope.actions').cycle_history_next, ["<C-Up>"] = require('telescope.actions').cycle_history_prev, } } } } For more information :help telescope.defaults.history big thanks to clason and all other testers :)
Diffstat (limited to 'lua/telescope/actions/set.lua')
-rw-r--r--lua/telescope/actions/set.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/lua/telescope/actions/set.lua b/lua/telescope/actions/set.lua
index 5b39c54..e790e34 100644
--- a/lua/telescope/actions/set.lua
+++ b/lua/telescope/actions/set.lua
@@ -48,6 +48,20 @@ action_set.select = function(prompt_bufnr, type)
return action_set.edit(prompt_bufnr, action_state.select_key_to_edit_key(type))
end
+-- goal: currently we have a workaround in actions/init.lua where we do this for all files
+-- action_set.select = {
+-- -- Will not be called if `select_default` is replaced rather than `action_set.select` because we never get here
+-- pre = function(prompt_bufnr)
+-- action_state.get_current_history():append(
+-- action_state.get_current_line(),
+-- action_state.get_current_picker(prompt_bufnr)
+-- )
+-- end,
+-- action = function(prompt_bufnr, type)
+-- return action_set.edit(prompt_bufnr, action_state.select_key_to_edit_key(type))
+-- end
+-- }
+
local edit_buffer
do
local map = {