To: vim_dev@googlegroups.com Subject: Patch 8.2.1237 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1237 Problem: Changing 'completepopup' after opening a popup has no effect. (Jay Sitter) Solution: Close the popup when the options are changed. (closes #6471) Files: runtime/doc/options.txt, src/popupwin.c, src/proto/popupwin.pro, src/optionstr.c, src/testdir/test_popupwin.vim, src/testdir/dumps/Test_popupwin_infopopup_8.dump *** ../vim-8.2.1236/runtime/doc/options.txt 2020-07-05 14:10:09.745447442 +0200 --- runtime/doc/options.txt 2020-07-18 16:04:44.262062175 +0200 *************** *** 1949,1957 **** {not available when compiled without the |+textprop| or |+quickfix| feature} When 'completeopt' contains "popup" then this option is used for the ! properties of the info popup when it is created. You can also use ! |popup_findinfo()| and then set properties for an existing info popup ! with |popup_setoptions()|. See |complete-popup|. *'concealcursor'* *'cocu'* --- 1951,1961 ---- {not available when compiled without the |+textprop| or |+quickfix| feature} When 'completeopt' contains "popup" then this option is used for the ! properties of the info popup when it is created. If an info popup ! window already exists it is closed, so that the option value is ! applied when it is created again. ! You can also use |popup_findinfo()| and then set properties for an ! existing info popup with |popup_setoptions()|. See |complete-popup|. *'concealcursor'* *'cocu'* *** ../vim-8.2.1236/src/popupwin.c 2020-07-15 18:27:03.168733637 +0200 --- src/popupwin.c 2020-07-18 15:51:12.791169901 +0200 *************** *** 4031,4036 **** --- 4031,4048 ---- if (wp != NULL) popup_hide(wp); } + + /* + * Close any info popup. + */ + void + popup_close_info(void) + { + win_T *wp = popup_find_info_window(); + + if (wp != NULL) + popup_close_with_retval(wp, -1); + } #endif /* *** ../vim-8.2.1236/src/proto/popupwin.pro 2020-05-13 16:34:10.401723784 +0200 --- src/proto/popupwin.pro 2020-07-18 15:52:12.662945169 +0200 *************** *** 60,65 **** --- 60,66 ---- int popup_create_preview_window(int info); void popup_close_preview(void); void popup_hide_info(void); + void popup_close_info(void); int popup_win_closed(win_T *win); void popup_set_title(win_T *wp); void popup_update_preview_title(void); *** ../vim-8.2.1236/src/optionstr.c 2020-06-10 21:46:56.387670023 +0200 --- src/optionstr.c 2020-07-18 16:05:09.662029844 +0200 *************** *** 2249,2254 **** --- 2249,2256 ---- { if (parse_completepopup(NULL) == FAIL) errmsg = e_invarg; + else + popup_close_info(); } # endif #endif *** ../vim-8.2.1236/src/testdir/test_popupwin.vim 2020-07-15 17:37:59.053523797 +0200 --- src/testdir/test_popupwin.vim 2020-07-18 16:01:35.346230702 +0200 *************** *** 3109,3114 **** --- 3109,3120 ---- call term_sendkeys(buf, "otest text test text\\") call VerifyScreenDump(buf, 'Test_popupwin_infopopup_7', {}) + " Test that when the option is changed the popup changes. + call term_sendkeys(buf, "\") + call term_sendkeys(buf, ":set completepopup=border:off\") + call term_sendkeys(buf, "a\\") + call VerifyScreenDump(buf, 'Test_popupwin_infopopup_8', {}) + call term_sendkeys(buf, "\") call StopVimInTerminal(buf) call delete('XtestInfoPopup') *** ../vim-8.2.1236/src/testdir/dumps/Test_popupwin_infopopup_8.dump 2020-07-18 16:06:01.261958120 +0200 --- src/testdir/dumps/Test_popupwin_infopopup_8.dump 2020-07-18 16:01:49.426223144 +0200 *************** *** 0 **** --- 1,14 ---- + |a+0&#ffffff0|w|o|r|d| @69 + |t|e|s|t| |t|a|w|o|r|d> @63 + |~+0#4040ff13&| @3| +0#0000001#e0e0e08|w|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| @1| +0#0000000#0000001| +0#0000001#e0e0e08|w|o|r|d|s| |a|r|e| |c|o@1|l| | +0#4040ff13#ffffff0@29 + |~| @3| +0#0000001#ffd7ff255|a|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| @1| +0#0000000#0000001| +0#4040ff13#ffffff0@45 + |~| @3| +0#0000001#ffd7ff255|n|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| @1| +0#0000000#a8a8a8255| +0#4040ff13#ffffff0@45 + |~| @73 + |~| @73 + |~| @73 + |~| @73 + |~| @73 + |~| @73 + |~| @73 + |~| @73 + |-+2#0000000&@1| |U|s|e|r| |d|e|f|i|n|e|d| |c|o|m|p|l|e|t|i|o|n| |(|^|U|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |4| +0#0000000&@26 *** ../vim-8.2.1236/src/version.c 2020-07-18 15:16:58.307407071 +0200 --- src/version.c 2020-07-18 15:53:00.470765939 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1237, /**/ -- Everyone has a photographic memory. Some don't have film. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///