mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
vim-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)1cb16c3a20
Co-authored-by: Bram Moolenaar <Bram@vim.org> (cherry picked from commit52b3e8bdef
)
This commit is contained in:
parent
65c8851098
commit
78caeae92f
@ -933,6 +933,8 @@ void textpos2screenpos(win_T *wp, pos_T *pos, int *rowp, int *scolp, int *ccolp,
|
|||||||
linenr_T lnum = pos->lnum;
|
linenr_T lnum = pos->lnum;
|
||||||
is_folded = hasFoldingWin(wp, lnum, &lnum, NULL, true, NULL);
|
is_folded = hasFoldingWin(wp, lnum, &lnum, NULL, true, NULL);
|
||||||
row = plines_m_win(wp, wp->w_topline, lnum - 1) + 1;
|
row = plines_m_win(wp, wp->w_topline, lnum - 1) + 1;
|
||||||
|
// Add filler lines above this buffer line.
|
||||||
|
row += win_get_fill(wp, lnum);
|
||||||
visible_row = true;
|
visible_row = true;
|
||||||
} else if (!local || pos->lnum < wp->w_topline) {
|
} else if (!local || pos->lnum < wp->w_topline) {
|
||||||
row = 0;
|
row = 0;
|
||||||
|
@ -144,6 +144,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
|
||||||
|
Loading…
Reference in New Issue
Block a user