Added preview width and relative size
Signed-off-by: Freyskeyd <simon.paitrault@gmail.com>
This commit is contained in:
@@ -9,6 +9,9 @@ M.defaults = {
|
||||
border = 'single',
|
||||
relative_width = true,
|
||||
width = 25,
|
||||
preview_min_width = 100,
|
||||
preview_width = 50,
|
||||
relative_preview_width = true,
|
||||
auto_close = false,
|
||||
auto_preview = true,
|
||||
show_numbers = false,
|
||||
@@ -80,6 +83,20 @@ function M.get_window_width()
|
||||
end
|
||||
end
|
||||
|
||||
function M.get_preview_width()
|
||||
if M.options.relative_preview_width then
|
||||
local relative_width = math.ceil(vim.o.columns * (M.options.preview_width / 100))
|
||||
|
||||
if relative_width < M.options.preview_min_width then
|
||||
return M.options.preview_min_width
|
||||
else
|
||||
return relative_width
|
||||
end
|
||||
else
|
||||
return M.options.preview_width
|
||||
end
|
||||
end
|
||||
|
||||
function M.get_split_command()
|
||||
if M.options.position == 'left' then
|
||||
return 'topleft vs'
|
||||
|
||||
Reference in New Issue
Block a user