diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-06-05 06:33:43 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-06-05 07:49:44 +0800 |
commit | 49ede0a68f1f8fd46dc9715fb1f332a13d13dbe3 (patch) | |
tree | 788a34af81a3535586a21682c2cd1dfc9705de95 /src | |
parent | 5282d3299c9b1b07f3e02a9014bc2632cf3b4fed (diff) | |
download | rneovim-49ede0a68f1f8fd46dc9715fb1f332a13d13dbe3.tar.gz rneovim-49ede0a68f1f8fd46dc9715fb1f332a13d13dbe3.tar.bz2 rneovim-49ede0a68f1f8fd46dc9715fb1f332a13d13dbe3.zip |
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)
https://github.com/vim/vim/commit/f0e68c0e2a3539f899e737e5b167622fe081fbbd
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/move.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c index 48691db26d..57466120e9 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -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() |