comparison src/move.c @ 27352:2bec1976362c v8.2.4204

patch 8.2.4204: screenpos() has non-zero row for invisible text Commit: https://github.com/vim/vim/commit/7924a17791217d50be5a91989a9641bf68e7a735 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 24 16:15:15 2022 +0000 patch 8.2.4204: screenpos() has non-zero row for invisible text Problem: screenpos() has non-zero row for invisible text. Solution: Only add the window row when the text is visible. (closes https://github.com/vim/vim/issues/9618)
author Bram Moolenaar <Bram@vim.org>
date Mon, 24 Jan 2022 17:30:05 +0100
parents fc859aea8cec
children d3ed8b1a7bde
comparison
equal deleted inserted replaced
27351:972de339c4de 27352:2bec1976362c
1260 } 1260 }
1261 col -= wp->w_leftcol; 1261 col -= wp->w_leftcol;
1262 if (col >= wp->w_width) 1262 if (col >= wp->w_width)
1263 col = -1; 1263 col = -1;
1264 if (col >= 0 && row + rowoff <= wp->w_height) 1264 if (col >= 0 && row + rowoff <= wp->w_height)
1265 {
1265 coloff = col - scol + wp->w_wincol + 1; 1266 coloff = col - scol + wp->w_wincol + 1;
1267 row += W_WINROW(wp);
1268 }
1266 else 1269 else
1267 // character is left, right or below of the window 1270 // character is left, right or below of the window
1268 row = rowoff = scol = ccol = ecol = 0; 1271 row = rowoff = scol = ccol = ecol = 0;
1269 } 1272 }
1270 *rowp = W_WINROW(wp) + row + rowoff; 1273 *rowp = row + rowoff;
1271 *scolp = scol + coloff; 1274 *scolp = scol + coloff;
1272 *ccolp = ccol + coloff; 1275 *ccolp = ccol + coloff;
1273 *ecolp = ecol + coloff; 1276 *ecolp = ecol + coloff;
1274 } 1277 }
1275 #endif 1278 #endif