diff options
| author | TJ DeVries <devries.timothyj@gmail.com> | 2020-08-29 22:15:40 -0400 |
|---|---|---|
| committer | TJ DeVries <devries.timothyj@gmail.com> | 2020-08-29 22:15:40 -0400 |
| commit | ae9b76929957a1eb20ea016c6ce9d34bc0d8b213 (patch) | |
| tree | 4b129c1d53e9df1c7cb663a6bacb9b6dc84605d7 /lua/telescope/mappings.lua | |
| parent | 711536859370510531744f6b239004a67c2e1a7e (diff) | |
feat: Add selection and start actions
Diffstat (limited to 'lua/telescope/mappings.lua')
| -rw-r--r-- | lua/telescope/mappings.lua | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lua/telescope/mappings.lua b/lua/telescope/mappings.lua index 1bcf1d2..6bbbac5 100644 --- a/lua/telescope/mappings.lua +++ b/lua/telescope/mappings.lua @@ -1,6 +1,7 @@ -- TODO: Customize keymap local a = vim.api +local actions = require('telescope.actions') local state = require('telescope.state') local mappings = {} @@ -29,10 +30,6 @@ mappings.set_keymap = function(prompt_bufnr, results_bufnr) default_mapper('<CR>', 'enter') end -local function update_current_selection(prompt_bufnr, change) - state.get_status(prompt_bufnr).picker:move_selection(change) -end - function __TelescopeMapping(prompt_bufnr, results_bufnr, characters) if keymap[characters] then @@ -44,11 +41,11 @@ end -- TODO: Move from top to bottom, etc. -- TODO: It seems like doing this brings us back to the beginning of the prompt, which is not great. keymap["control-n"] = function(prompt_bufnr, _) - update_current_selection(prompt_bufnr, 1) + actions.shift_current_selection(prompt_bufnr, 1) end keymap["control-p"] = function(prompt_bufnr, _) - update_current_selection(prompt_bufnr, -1) + actions.shift_current_selection(prompt_bufnr, -1) end keymap["enter"] = function(prompt_bufnr, results_bufnr) |
