Skip to content

Commit

Permalink
fix nightly return lua type
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir committed Mar 9, 2024
1 parent 7cabe94 commit 0f1cae9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lua/lspsaga/codeaction/preview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ local function create_preview_win(content, main_winid)
local opt = {
relative = win_conf.relative,
win = win_conf.win,
col = win_conf.col[false],
col = util.is_ten and win_conf.col or win_conf.col[false],
anchor = win_conf.anchor,
focusable = false,
}
local max_width = api.nvim_win_get_width(win_conf.win) - win_conf.col[false] - 8
local max_width = api.nvim_win_get_width(win_conf.win)
- (util.is_ten and win_conf.col or win_conf.col[false])
- 8
local content_width = util.get_max_content_length(content)
if content_width > max_width then
opt.width = max_width
Expand All @@ -110,10 +112,10 @@ local function create_preview_win(content, main_winid)

local winheight = api.nvim_win_get_height(win_conf.win)
if win_conf.anchor:find('^S') then
opt.row = win_conf.row[false] - win_conf.height - 2
max_height = win_conf.row[false] - win_conf.height
opt.row = util.is_ten and win_conf.row or win_conf.row[false] - win_conf.height - 2
max_height = util.is_ten and win_conf.row or win_conf.row[false] - win_conf.height
elseif win_conf.anchor:find('^N') then
opt.row = win_conf.row[false] + win_conf.height + 2
opt.row = util.is_ten and win_conf.row or win_conf.row[false] + win_conf.height + 2
max_height = winheight - opt.row
end

Expand Down

0 comments on commit 0f1cae9

Please sign in to comment.