To: vim_dev@googlegroups.com Subject: Patch 9.0.1016 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1016 Problem: screenpos() does not count filler lines for diff mode. Solution: Add filler lines. (closes 11658) Files: src/move.c, src/testdir/test_cursor_func.vim *** ../vim-9.0.1015/src/move.c 2022-12-05 16:23:20.594894902 +0000 --- src/move.c 2022-12-05 22:19:42.182536744 +0000 *************** *** 1426,1431 **** --- 1426,1437 ---- is_folded = hasFoldingWin(wp, lnum, &lnum, NULL, TRUE, NULL); #endif 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 if (is_folded) { *** ../vim-9.0.1015/src/testdir/test_cursor_func.vim 2022-12-05 16:23:20.594894902 +0000 --- src/testdir/test_cursor_func.vim 2022-12-05 22:25:08.423001470 +0000 *************** *** 156,161 **** --- 156,177 ---- bwipe! 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() rightbelow new rightbelow 73vsplit *** ../vim-9.0.1015/src/version.c 2022-12-05 21:55:49.183027029 +0000 --- src/version.c 2022-12-05 22:21:09.114675327 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1016, /**/ -- "Women marry men hoping they will change. Men marry women hoping they will not. So each is inevitably disappointed." - Einstein /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///