vis: fzf.sh allow multi select (puts to messages), skip register value if default register
This commit is contained in:
@@ -263,6 +263,7 @@ fi
|
||||
exec fzf --query "$3" \
|
||||
--prompt "$prompt" \
|
||||
--header-label "$label" \
|
||||
--multi \
|
||||
--ansi \
|
||||
--delimiter : \
|
||||
--ghost ' (Use alt-? for help)' \
|
||||
|
||||
@@ -93,13 +93,17 @@ end
|
||||
|
||||
local function fzf_sh(arg)
|
||||
action = function(out)
|
||||
if (out:find('\n') or #out) == #out then
|
||||
open_file_pos(out, vis.win.file.modified and 'o' or 'e')
|
||||
else
|
||||
vis:message(out)
|
||||
end
|
||||
end
|
||||
local home = os.getenv('HOME')
|
||||
local path = vis.win.file.path or ''
|
||||
local dir = path:match('^.*/') or ''
|
||||
local reg = ''
|
||||
if reg ~= '"' then
|
||||
if vis.register ~= '"' then
|
||||
reg = string.gsub(vis.registers[vis.register][1], '%z', '')
|
||||
end
|
||||
local cmd = home ..
|
||||
@@ -111,7 +115,11 @@ end
|
||||
local function search(cmd, action)
|
||||
if action == nil then
|
||||
action = function(out)
|
||||
if (out:find('\n') or #s) == #s then
|
||||
open_file_pos(out, 'e')
|
||||
else
|
||||
vis:message(out)
|
||||
end
|
||||
end
|
||||
end
|
||||
if cmd:match('^fzf ') and vis.register ~= '"' then
|
||||
|
||||
Reference in New Issue
Block a user