From ffa36d85e245796c0f13c1f89e50970f1084b828 Mon Sep 17 00:00:00 2001 From: bekaboo <18127878294@qq.com> Date: Wed, 24 Jan 2024 17:26:31 +0800 Subject: [PATCH] feat(configs): new keymap `` & `` to navigate when fuzzy-find --- README.md | 54 +++++++++++++---------------------------- doc/dropbar.txt | 28 +++++++-------------- lua/dropbar/configs.lua | 26 ++++++-------------- 3 files changed, 34 insertions(+), 74 deletions(-) diff --git a/README.md b/README.md index a45f2ffb..51498c0b 100644 --- a/README.md +++ b/README.md @@ -644,27 +644,17 @@ vim.ui.select = require('dropbar.utils.menu').select end menu:update_hover_hl({ mouse.line, mouse.column - 1 }) end, - [''] = function() - api.fuzzy_find_toggle() - end, - [''] = function() - api.fuzzy_find_click() - end, + [''] = api.fuzzy_find_prev, + [''] = api.fuzzy_find_next, + [''] = api.fuzzy_find_prev, + [''] = api.fuzzy_find_next, + [''] = api.fuzzy_find_prev, + [''] = api.fuzzy_find_next, + [''] = api.fuzzy_find_toggle, + [''] = api.fuzzy_find_click, [''] = function() api.fuzzy_find_click(-1) end, - [''] = function() - api.fuzzy_find_navigate('up') - end, - [''] = function() - api.fuzzy_find_navigate('down') - end, - [''] = function() - api.fuzzy_find_navigate('up') - end, - [''] = function() - api.fuzzy_find_navigate('down') - end, }, win_configs = {}, prompt = '%#htmlTag# ', @@ -1292,26 +1282,16 @@ appearance of the fuzzy finder interface. end menu:update_hover_hl({ mouse.line, mouse.column - 1 }) end, - [''] = function() - require('dropbar.api').fuzzy_find_toggle() - end, - [''] = function() - require('dropbar.api').fuzzy_find_click() - end, + [''] = api.fuzzy_find_prev, + [''] = api.fuzzy_find_next, + [''] = api.fuzzy_find_prev, + [''] = api.fuzzy_find_next, + [''] = api.fuzzy_find_prev, + [''] = api.fuzzy_find_next, + [''] = api.fuzzy_find_toggle, + [''] = api.fuzzy_find_click, [''] = function() - require('dropbar.api').fuzzy_find_click(-1) - end, - [''] = function() - require('dropbar.api').fuzzy_find_navigate('up') - end, - [''] = function() - require('dropbar.api').fuzzy_find_navigate('down') - end, - [''] = function() - require('dropbar.api').fuzzy_find_navigate('up') - end, - [''] = function() - require('dropbar.api').fuzzy_find_navigate('down') + api.fuzzy_find_click(-1) end, } ``` diff --git a/doc/dropbar.txt b/doc/dropbar.txt index c41a7a55..0636fc89 100644 --- a/doc/dropbar.txt +++ b/doc/dropbar.txt @@ -700,26 +700,16 @@ appearance of the fuzzy finder interface. end menu:update_hover_hl({ mouse.line, mouse.column - 1 }) end, - [''] = function() - require('dropbar.api').fuzzy_find_toggle() - end, - [''] = function() - require('dropbar.api').fuzzy_find_click() - end, + [''] = api.fuzzy_find_prev, + [''] = api.fuzzy_find_next, + [''] = api.fuzzy_find_prev, + [''] = api.fuzzy_find_next, + [''] = api.fuzzy_find_prev, + [''] = api.fuzzy_find_next, + [''] = api.fuzzy_find_toggle, + [''] = api.fuzzy_find_click, [''] = function() - require('dropbar.api').fuzzy_find_click(-1) - end, - [''] = function() - require('dropbar.api').fuzzy_find_navigate('up') - end, - [''] = function() - require('dropbar.api').fuzzy_find_navigate('down') - end, - [''] = function() - require('dropbar.api').fuzzy_find_navigate('up') - end, - [''] = function() - require('dropbar.api').fuzzy_find_navigate('down') + api.fuzzy_find_click(-1) end, } < diff --git a/lua/dropbar/configs.lua b/lua/dropbar/configs.lua index 8768a920..ede451f8 100644 --- a/lua/dropbar/configs.lua +++ b/lua/dropbar/configs.lua @@ -398,27 +398,17 @@ M.opts = { end menu:update_hover_hl({ mouse.line, mouse.column - 1 }) end, - [''] = function() - api.fuzzy_find_toggle() - end, - [''] = function() - api.fuzzy_find_click() - end, + [''] = api.fuzzy_find_prev, + [''] = api.fuzzy_find_next, + [''] = api.fuzzy_find_prev, + [''] = api.fuzzy_find_next, + [''] = api.fuzzy_find_prev, + [''] = api.fuzzy_find_next, + [''] = api.fuzzy_find_toggle, + [''] = api.fuzzy_find_click, [''] = function() api.fuzzy_find_click(-1) end, - [''] = function() - api.fuzzy_find_navigate('up') - end, - [''] = function() - api.fuzzy_find_navigate('down') - end, - [''] = function() - api.fuzzy_find_navigate('up') - end, - [''] = function() - api.fuzzy_find_navigate('down') - end, }, win_configs = {}, prompt = '%#htmlTag# ',