diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-24 16:15:15 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-24 16:15:15 +0000 |
commit | 7924a17791217d50be5a91989a9641bf68e7a735 (patch) | |
tree | b26e3fd8e77637d96eedf74a47996372b8a312b6 /src/move.c | |
parent | 502d8ae3e8ed8b6f8dd2ff175f154f9aa87228ef (diff) |
patch 8.2.4204: screenpos() has non-zero row for invisible textv8.2.4204
Problem: screenpos() has non-zero row for invisible text.
Solution: Only add the window row when the text is visible. (closes #9618)
Diffstat (limited to 'src/move.c')
-rw-r--r-- | src/move.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/move.c b/src/move.c index b8e8780aa5..f52e4c071e 100644 --- a/src/move.c +++ b/src/move.c @@ -1262,12 +1262,15 @@ textpos2screenpos( if (col >= wp->w_width) col = -1; if (col >= 0 && row + rowoff <= wp->w_height) + { coloff = col - scol + wp->w_wincol + 1; + row += W_WINROW(wp); + } else // character is left, right or below of the window row = rowoff = scol = ccol = ecol = 0; } - *rowp = W_WINROW(wp) + row + rowoff; + *rowp = row + rowoff; *scolp = scol + coloff; *ccolp = ccol + coloff; *ecolp = ecol + coloff; |