mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
fix(float): fix ml_get error with bufpos
(cherry picked from commit e120a049f0
)
This commit is contained in:
parent
9f5c5abd42
commit
bc4d11cd9d
@ -940,7 +940,7 @@ void textpos2screenpos(win_T *wp, pos_T *pos, int *rowp, int *scolp, int *ccolp,
|
||||
bool existing_row = (pos->lnum > 0
|
||||
&& pos->lnum <= wp->w_buffer->b_ml.ml_line_count);
|
||||
|
||||
if ((local && existing_row) || visible_row) {
|
||||
if ((local || visible_row) && existing_row) {
|
||||
colnr_T off;
|
||||
colnr_T col;
|
||||
int width;
|
||||
|
@ -827,7 +827,7 @@ void win_config_float(win_T *wp, FloatConfig fconfig)
|
||||
pos_T pos = { wp->w_float_config.bufpos.lnum + 1,
|
||||
wp->w_float_config.bufpos.col, 0 };
|
||||
int trow, tcol, tcolc, tcole;
|
||||
textpos2screenpos(wp, &pos, &trow, &tcol, &tcolc, &tcole, true);
|
||||
textpos2screenpos(parent, &pos, &trow, &tcol, &tcolc, &tcole, true);
|
||||
row += trow - 1;
|
||||
col += tcol - 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user