Skip to content

Commit

Permalink
layout fix float wrong right column
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir committed Sep 6, 2023
1 parent b89ae5b commit ebfa304
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lua/lspsaga/layout/float.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,13 @@ function M.right(left_winid, opt)
end

local WIDTH = api.nvim_win_get_width(win_conf.win)
local col = win_conf.col[false] + win_conf.width
local col = win_conf.col[false] + win_conf.width + 3
local row = win_conf.row[false]
local available = WIDTH - win_conf.width
win_conf.width = not opt.width and available - 15 or math.floor(WIDTH * opt.width)
local dif = vim.o.columns - api.nvim_win_get_height(win_conf.win)
if fn.winnr('$') > 1 and dif > 0 then
win_conf.width = win_conf.width + (dif >= 15 and 15 or 0)
end
win_conf.width = WIDTH == vim.o.columns and WIDTH - col
or (vim.o.columns - col >= 80 and 80 or vim.o.columns - col)

win_conf.row = row
win_conf.col = col + 2
win_conf.col = col
win_conf.title = nil
win_conf.title_pos = nil
if win_conf.border then
Expand Down

0 comments on commit ebfa304

Please sign in to comment.