mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 9.0.1016: screenpos() does not count filler lines for diff mode
Problem: screenpos() does not count filler lines for diff mode. Solution: Add filler lines. (closes 11658)
This commit is contained in:
parent
f0a9c00482
commit
1cb16c3a20
@ -1426,6 +1426,12 @@ textpos2screenpos(
|
|||||||
is_folded = hasFoldingWin(wp, lnum, &lnum, NULL, TRUE, NULL);
|
is_folded = hasFoldingWin(wp, lnum, &lnum, NULL, TRUE, NULL);
|
||||||
#endif
|
#endif
|
||||||
row = plines_m_win(wp, wp->w_topline, lnum - 1) + 1;
|
row = plines_m_win(wp, wp->w_topline, lnum - 1) + 1;
|
||||||
|
|
||||||
|
#ifdef FEAT_DIFF
|
||||||
|
// Add filler lines above this buffer line.
|
||||||
|
row += diff_check_fill(wp, lnum);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_FOLDING
|
#ifdef FEAT_FOLDING
|
||||||
if (is_folded)
|
if (is_folded)
|
||||||
{
|
{
|
||||||
|
@ -156,6 +156,22 @@ func Test_screenpos_fold()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_screenpos_diff()
|
||||||
|
CheckFeature diff
|
||||||
|
|
||||||
|
enew!
|
||||||
|
call setline(1, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'])
|
||||||
|
vnew
|
||||||
|
call setline(1, ['a', 'b', 'c', 'g', 'h', 'i'])
|
||||||
|
windo diffthis
|
||||||
|
wincmd w
|
||||||
|
call assert_equal(#{col: 3, row: 7, endcol: 3, curscol: 3}, screenpos(0, 4, 1))
|
||||||
|
|
||||||
|
windo diffoff
|
||||||
|
bwipe!
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_screenpos_number()
|
func Test_screenpos_number()
|
||||||
rightbelow new
|
rightbelow new
|
||||||
rightbelow 73vsplit
|
rightbelow 73vsplit
|
||||||
|
@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1016,
|
||||||
/**/
|
/**/
|
||||||
1015,
|
1015,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user