vis: set proper fzf padding in case of numbers or relativenumbers
This commit is contained in:
@@ -45,6 +45,15 @@ local function merge(a, b)
|
|||||||
return c
|
return c
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function padding()
|
||||||
|
local opt = vis.win.options
|
||||||
|
local l = 0
|
||||||
|
if opt.numbers or opt.relativenumbers then
|
||||||
|
l = #tostring(vis.win.viewport.lines.finish)
|
||||||
|
end
|
||||||
|
return '0,0,0,' .. l
|
||||||
|
end
|
||||||
|
|
||||||
local mu = #up_keys
|
local mu = #up_keys
|
||||||
local md = #down_keys
|
local md = #down_keys
|
||||||
local up = merge(up_keys, down_keys)
|
local up = merge(up_keys, down_keys)
|
||||||
@@ -137,7 +146,7 @@ local function jump(keys)
|
|||||||
end
|
end
|
||||||
input = input .. data:sub(k)
|
input = input .. data:sub(k)
|
||||||
|
|
||||||
local code, out, err = vis:pipe(input, 'fzf --ansi --layout=reverse-list --no-info --no-separator --color gutter:-1 --marker="" --padding 0,0,0,3 --print-query --bind change:accept')
|
local code, out, err = vis:pipe(input, 'fzf --ansi --layout=reverse-list --no-info --no-separator --color gutter:-1 --marker="" --padding ' .. padding() .. ' --print-query --bind change:accept')
|
||||||
if code ~= 0 then
|
if code ~= 0 then
|
||||||
vis:info(err or ('fzf exit code ' .. code))
|
vis:info(err or ('fzf exit code ' .. code))
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user