feat: add fixed width option

closes #79
This commit is contained in:
James Trew
2021-11-22 20:21:15 -05:00
parent 552b67993e
commit 4f231b8781
4 changed files with 24 additions and 8 deletions

View File

@@ -6,6 +6,7 @@ M.defaults = {
highlight_hovered_item = true,
show_guides = true,
position = 'right',
relative_width = true,
width = 25,
auto_preview = true,
show_numbers = false,
@@ -68,7 +69,15 @@ function M.get_position_navigation_direction()
end
end
function M.get_width_percentage() return M.options.width / 100 end
function M.get_window_width()
if M.options.relative_width then
-- local current_win_width = vim.api.nvim_win_get_width(0)
return math.ceil(vim.api.nvim_win_get_width(0) * (M.options.width / 100))
else
return M.options.width
end
end
function M.get_split_command()
if M.options.position == 'left' then