Skip to content

Commit

Permalink
limit diagnostic jump window height
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir committed May 15, 2024
1 parent 249f44f commit 71abf36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/lspsaga/diagnostic/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ function diag:code_action_cb(action_tuples, enriched_ctx)
end
end
local increase = util.win_height_increase(contents, math.abs(win_conf.width / vim.o.columns))

local start_line = api.nvim_buf_line_count(self.bufnr) + 1
local limit_height = math.floor(api.nvim_win_get_height(0) / 3)
win
:from_exist(self.bufnr, self.winid)
:winsetconf({ height = win_conf.height + increase + #contents })
:winsetconf({ height = math.min(win_conf.height + increase + #contents, limit_height) })
:bufopt('modifiable', true)
:setlines(contents, -1, -1)
:bufopt('modifiable', false)
Expand Down

0 comments on commit 71abf36

Please sign in to comment.