On 30-Oct-2024 06:45, Christian Brabandt wrote:
patch 9.1.0822: topline might be changed in diff mode unexpectedly
Commit:https://github.com/vim/vim/commit/05a40e07c2f0e41b708c4c75a6aa7d0e7f6201a3
Author: Christian Brabandt<c...@256bit.org>
Date: Tue Oct 29 20:29:04 2024 +0100
patch 9.1.0822: topline might be changed in diff mode unexpectedly
Problem: topline might be changed in diff mode unexpectedly
(Jaehwang Jung)
Solution: do not re-calculate topline, when using line() func
in diff mode.
fixes: #15812
closes: #15950
Signed-off-by: Christian Brabandt<c...@256bit.org>
After this patch, my Windows x64 build fails with this error because
FEAT_DIFF is not defined:
<snip>
clang -c -I. -Iproto -DWIN32 -DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00
-DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO
-pipe -Wall -O3 -fomit-frame-pointer -fpie -fPIE -DFEAT_GUI_MSWIN
-DFEAT_CLIPBOARD evalfunc.c -o gobjx86-64/evalfunc.o
evalfunc.c:8364:15: error: no member named 'w_p_diff' in 'struct window_S'
8364 | if (curwin->w_p_diff &&
switchwin.sw_curwin->w_p_diff)
| ~~~~~~ ^
evalfunc.c:8364:48: error: no member named 'w_p_diff' in 'struct window_S'
8364 | if (curwin->w_p_diff &&
switchwin.sw_curwin->w_p_diff)
| ~~~~~~~~~~~~~~~~~~~ ^
evalfunc.c:8369:18: error: no member named 'w_p_diff' in 'struct window_S'
8369 | if (curwin->w_p_diff && switchwin.sw_curwin->w_p_diff)
| ~~~~~~ ^
evalfunc.c:8369:51: error: no member named 'w_p_diff' in 'struct window_S'
8369 | if (curwin->w_p_diff && switchwin.sw_curwin->w_p_diff)
| ~~~~~~~~~~~~~~~~~~~ ^
4 errors generated.
make: *** [Make_cyg_ming.mak:1252: gobjx86-64/evalfunc.o] Error 1
</snip>
The attached patch fixes the build failure but I'm not sure if it's the
right fix.
Cheers
John
--
--
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/653ae4ba-3738-44d6-b87c-9da47c55da3a%40internode.on.net.
--- evalfunc.c.orig 2024-10-30 08:08:00 +0000
+++ evalfunc.c 2024-10-30 08:23:39 +0000
@@ -8359,15 +8359,19 @@
{
if (switch_win_noblock(&switchwin, wp, tp, TRUE) == OK)
{
+#ifdef FEAT_DIFF
// in diff mode, prevent that the window scrolls
// and keep the topline
if (curwin->w_p_diff && switchwin.sw_curwin->w_p_diff)
skip_update_topline = TRUE;
+#endif
check_cursor();
fp = var2fpos(&argvars[0], TRUE, &fnum, FALSE);
}
+#ifdef FEAT_DIFF
if (curwin->w_p_diff && switchwin.sw_curwin->w_p_diff)
skip_update_topline = FALSE;
+#endif
restore_win_noblock(&switchwin, TRUE);
}
}