diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-17 22:58:53 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-08-17 22:58:53 +0200 |
commit | bfe377b8f2d080e5f85c8cbecf3533456e1d6312 (patch) | |
tree | d709875e1dfbd342fe59b999cfeaa981761e2f3f /src/misc1.c | |
parent | 825cf813fa0fddf085fcbd3194781e875320ff63 (diff) |
patch 9.0.1729: screenpos() wrong when w_skipcol and cpoptions+=nv9.0.1729
Problem: screenpos() wrong result with w_skipcol and cpoptions+=n
Solution: Use adjust_plines_for_skipcol() instead of subtracting
w_skipcol.
closes: #12625
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Diffstat (limited to 'src/misc1.c')
-rw-r--r-- | src/misc1.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/misc1.c b/src/misc1.c index 4ef5e14e2b..72083504a3 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -342,12 +342,13 @@ plines(linenr_T lnum) plines_win( win_T *wp, linenr_T lnum, - int winheight) // when TRUE limit to window height + int limit_winheight) // when TRUE limit to window height { #if defined(FEAT_DIFF) || defined(PROTO) // Check for filler lines above this buffer line. When folded the result // is one line anyway. - return plines_win_nofill(wp, lnum, winheight) + diff_check_fill(wp, lnum); + return plines_win_nofill(wp, lnum, limit_winheight) + + diff_check_fill(wp, lnum); } /* @@ -364,7 +365,7 @@ plines_nofill(linenr_T lnum) plines_win_nofill( win_T *wp, linenr_T lnum, - int winheight) // when TRUE limit to window height + int limit_winheight) // when TRUE limit to window height { #endif int lines; @@ -389,7 +390,7 @@ plines_win_nofill( else lines = plines_win_nofold(wp, lnum); - if (winheight > 0 && lines > wp->w_height) + if (limit_winheight && lines > wp->w_height) return wp->w_height; return lines; } @@ -497,7 +498,7 @@ plines_win_col(win_T *wp, linenr_T lnum, long column) } int -plines_m_win(win_T *wp, linenr_T first, linenr_T last) +plines_m_win(win_T *wp, linenr_T first, linenr_T last, int limit_winheight) { int count = 0; @@ -519,10 +520,11 @@ plines_m_win(win_T *wp, linenr_T first, linenr_T last) { #ifdef FEAT_DIFF if (first == wp->w_topline) - count += plines_win_nofill(wp, first, TRUE) + wp->w_topfill; + count += plines_win_nofill(wp, first, limit_winheight) + + wp->w_topfill; else #endif - count += plines_win(wp, first, TRUE); + count += plines_win(wp, first, limit_winheight); ++first; } } |