Merge upstream PR 130 (preview width control)

simrat39/symbols-outline.nvim#130
This commit is contained in:
hedy
2023-11-08 14:23:38 +08:00
2 changed files with 26 additions and 10 deletions

View File

@@ -32,7 +32,7 @@ M.defaults = {
preview_window = {
auto_preview = false,
width = 50,
min_width = 100,
min_width = 50,
relative_width = true,
bg_hl = 'Pmenu',
border = 'single',
@@ -132,6 +132,20 @@ function M.get_window_width()
end
end
function M.get_preview_width()
if M.o.preview_window.relative_width then
local relative_width = math.ceil(vim.o.columns * (M.o.preview_window.width / 100))
if relative_width < M.o.preview_window.min_width then
return M.o.preview_window.min_width
else
return relative_width
end
else
return M.o.preview_window.width
end
end
function M.get_split_command()
if M.o.outline_window.position == 'left' then
return 'topleft vs'