Patch 9.0.1493
Problem: Popup menu position wrong in window with toolbar.
Solution: Take the window toolbar into account when positioning the popup
menu. (closes #12308)
Files: src/popupmenu.c, src/testdir/test_popup.vim,
src/testdir/dumps/Test_popup_command_06.dump
*** ../vim-9.0.1492/src/popupmenu.c 2023-04-23 16:23:48.505183683 +0100
--- src/popupmenu.c 2023-04-27 19:29:39.595378553 +0100
***************
*** 1649,1655 ****
{
// Hack: set mouse position at the cursor so that the menu pops up
// around there.
! mouse_row = curwin->w_winrow + curwin->w_wrow;
mouse_col = curwin->w_wincol + curwin->w_wcol;
}
--- 1649,1655 ----
{
// Hack: set mouse position at the cursor so that the menu pops up
// around there.
! mouse_row = W_WINROW(curwin) + curwin->w_wrow;
mouse_col = curwin->w_wincol + curwin->w_wcol;
}
*** ../vim-9.0.1492/src/testdir/test_popup.vim 2023-03-10 16:34:27.568958670
+0000
--- src/testdir/test_popup.vim 2023-04-27 19:35:50.234039527 +0100
***************
*** 910,916 ****
" Set a timer to change a menu entry while it's displayed. The text should
" not change but the command does. Making the screendump also verifies that
! " "changed" shows up, which means the timer triggered
call term_sendkeys(buf, "/X\<CR>:call StartTimer() | popup PopUp\<CR>")
call VerifyScreenDump(buf, 'Test_popup_command_04', {})
--- 910,916 ----
" Set a timer to change a menu entry while it's displayed. The text should
" not change but the command does. Making the screendump also verifies that
! " "changed" shows up, which means the timer triggered.
call term_sendkeys(buf, "/X\<CR>:call StartTimer() | popup PopUp\<CR>")
call VerifyScreenDump(buf, 'Test_popup_command_04', {})
***************
*** 918,923 ****
--- 918,932 ----
call term_sendkeys(buf, "jj\<CR>")
call VerifyScreenDump(buf, 'Test_popup_command_05', {})
+ call term_sendkeys(buf, "\<Esc>")
+
+ " Add a window toolbar to the window and check the :popup menu position.
+ call term_sendkeys(buf, ":nnoremenu WinBar.TEST :\<CR>")
+ call term_sendkeys(buf, "/X\<CR>:popup PopUp\<CR>")
+ call VerifyScreenDump(buf, 'Test_popup_command_06', {})
+
+ call term_sendkeys(buf, "\<Esc>")
+
call StopVimInTerminal(buf)
endfunc
*** ../vim-9.0.1492/src/testdir/dumps/Test_popup_command_06.dump
2023-04-27 19:36:27.181931137 +0100
--- src/testdir/dumps/Test_popup_command_06.dump 2023-04-27
19:29:39.599378536 +0100
***************
*** 0 ****
--- 1,20 ----
+ | +0&#e0e0e08| +2#ffffff16#6c6c6c255|T|E|S|T| | +0#0000000#e0e0e08@67
+ |o+0&#ffffff0|n|e| |t|w|o| |t|h|r|e@1| |f|o|u|r| |f|i|v|e| @51
+ |a|n|d| |o|n|e| |t|w|o| >X|t|h|r|e@1| |f|o|u|r| |f|i|v|e| @46
+ |o|n|e| |m|o|r|e| |t|w| +0#0000001#ffd7ff255|U|n|d|o| @12|
+0#0000000#ffffff0@45
+ |~+0#4040ff13&| @9| +0#0000001#ffd7ff255@17| +0#4040ff13#ffffff0@45
+ |~| @9| +0#0000001#ffd7ff255|P|a|s|t|e| @11| +0#4040ff13#ffffff0@45
+ |~| @9| +0#0000001#ffd7ff255@17| +0#4040ff13#ffffff0@45
+ |~| @9| +0#0000001#ffd7ff255|S|e|l|e|c|t| |W|o|r|d| @5| +0#4040ff13#ffffff0@45
+ |~| @9| +0#0000001#ffd7ff255|S|e|l|e|c|t| |S|e|n|t|e|n|c|e| @1|
+0#4040ff13#ffffff0@45
+ |~| @9| +0#0000001#ffd7ff255|S|e|l|e|c|t| |P|a|r|a|g|r|a|p|h| |
+0#4040ff13#ffffff0@45
+ |~| @9| +0#0000001#ffd7ff255|S|e|l|e|c|t| |L|i|n|e| @5| +0#4040ff13#ffffff0@45
+ |~| @9| +0#0000001#ffd7ff255|S|e|l|e|c|t| |B|l|o|c|k| @4|
+0#4040ff13#ffffff0@45
+ |~| @9| +0#0000001#ffd7ff255|S|e|l|e|c|t| |A|l@1| @6| +0#4040ff13#ffffff0@45
+ |~| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ |:+0#0000000&|p|o|p|u|p| |P|o|p|U|p| @62
*** ../vim-9.0.1492/src/version.c 2023-04-27 16:24:03.592501355 +0100
--- src/version.c 2023-04-27 19:31:11.658993746 +0100
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1493,
/**/
--
DENNIS: Oh, very nice. King, eh! I expect you've got a palace and fine
clothes and courtiers and plenty of food. And how d'you get that? By
exploiting the workers! By hanging on to outdated imperialist dogma
which perpetuates the social and economic differences in our society!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// 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/20230427183730.89E0E1C0114%40moolenaar.net.