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 -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20221205223221.EE5341C1D84%40moolenaar.net.