vim-patch:9.0.1600: screenpos() does not take w_skipcol into account

Problem:    screenpos() does not take w_skipcol into account.
Solution:   Subtract w_skipcol from column. (closes vim/vim#12486, closes vim/vim#12476)

f0e68c0e2a
This commit is contained in:
zeertzjq
2023-06-05 06:33:43 +08:00
parent 5282d3299c
commit 49ede0a68f
2 changed files with 38 additions and 1 deletions

View File

@@ -1098,6 +1098,10 @@ void textpos2screenpos(win_T *wp, pos_T *pos, int *rowp, int *scolp, int *ccolp,
col += off;
int width = wp->w_width_inner - off + win_col_off2(wp);
if (pos->lnum == wp->w_topline) {
col -= wp->w_skipcol;
}
// long line wrapping, adjust row
if (wp->w_p_wrap && col >= (colnr_T)wp->w_width_inner && width > 0) {
// use same formula as what is used in curs_columns()