diff src/move.c @ 32537:da44475fb8f5 v9.0.1600

patch 9.0.1600: screenpos() does not take w_skipcol into account Commit: https://github.com/vim/vim/commit/f0e68c0e2a3539f899e737e5b167622fe081fbbd Author: zeertzjq <zeertzjq@outlook.com> Date: Sat Jun 3 17:11:47 2023 +0100 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 https://github.com/vim/vim/issues/12486, closes https://github.com/vim/vim/issues/12476)
author Bram Moolenaar <Bram@vim.org>
date Sat, 03 Jun 2023 18:15:05 +0200
parents c8b28054caec
children ca42967a3253
line wrap: on
line diff
--- a/src/move.c
+++ b/src/move.c
@@ -1479,6 +1479,9 @@ textpos2screenpos(
 	    col += off;
 	    width = wp->w_width - 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