mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 09:56:31 +00:00
fix(float): wrong position when bufpos is set
Problem: when lnum in bufpos is out of range the position of float is wired. Solution: avoid the height value out of buffer line range.
This commit is contained in:
@@ -221,7 +221,7 @@ void win_config_float(win_T *wp, WinConfig fconfig)
|
||||
row += row_off;
|
||||
col += col_off;
|
||||
if (wp->w_config.bufpos.lnum >= 0) {
|
||||
pos_T pos = { wp->w_config.bufpos.lnum + 1,
|
||||
pos_T pos = { MIN(wp->w_config.bufpos.lnum + 1, parent->w_buffer->b_ml.ml_line_count),
|
||||
wp->w_config.bufpos.col, 0 };
|
||||
int trow, tcol, tcolc, tcole;
|
||||
textpos2screenpos(parent, &pos, &trow, &tcol, &tcolc, &tcole, true);
|
||||
|
Reference in New Issue
Block a user