diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-01-04 21:10:51 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-01-04 21:17:53 +0100 |
| commit | 6211fa0766f8227a819df2248c8db25d5c58c01f (patch) | |
| tree | d3bccfd09fbbb75b9dd865d435c1bbb51e0dd3b0 /init.lua | |
| parent | 53cebbabeb224a0370848ee71eff80b9e6b67671 (diff) | |
| download | vis-lspc-6211fa0766f8227a819df2248c8db25d5c58c01f.tar.gz vis-lspc-6211fa0766f8227a819df2248c8db25d5c58c01f.zip | |
allow cursor keys when using vis-menu
vis uses vis:pipe to call vis-menu when completing filenames.
Simply copy what vis does. However, using vis:pipe does not work with
fzf. I do not understand why but the vis-menu special case seams to work.
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -367,11 +367,19 @@ local function lspc_select(choices) return choices[1] end + local status, output local cmd = 'printf "' .. menu_input .. '" | ' .. lspc.menu_cmd lspc.log('collect choice using: ' .. cmd) - local menu = io.popen(cmd) - local output = menu:read('*a') - local _, _, status = menu:close() + + if lspc.menu_cmd == 'vis-menu' then + status, output = vis:pipe(vis.win.file, {start = 0, finish = 0}, cmd) + else + local menu = io.popen(cmd) + output = menu:read('*a') + local _, _, _status = menu:close() + status = _status + + end local choice = nil if status == 0 then |
