# HG changeset patch # User Bram Moolenaar # Date 1560165307 -7200 # Node ID 905e1b154058c7964394955aac21e756f95194f3 # Parent 2e3d414420337551adc85c27b1e9d0cb6fa83f0f patch 8.1.1513: all popup functionality is in functions, except :popupclear commit https://github.com/vim/vim/commit/3ff5f0f05d437a6b3eaf3caa5dc2762b49314617 Author: Bram Moolenaar Date: Mon Jun 10 13:11:22 2019 +0200 patch 8.1.1513: all popup functionality is in functions, except :popupclear Problem: All popup functionality is in functions, except :popupclear. Solution: Add popup_clear() for consistency. Also rename sound_stopall() to sound_clear(). diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 8.1. Last change: 2019 Jun 06 +*eval.txt* For Vim version 8.1. Last change: 2019 Jun 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2623,12 +2623,12 @@ sin({expr}) Float sine of {expr} sinh({expr}) Float hyperbolic sine of {expr} sort({list} [, {func} [, {dict}]]) List sort {list}, using {func} to compare +sound_clear() none stop playing all sounds sound_playevent({name} [, {callback}]) Number play an event sound -sound_playfile({name} [, {callback}]) - Number play a sound file +sound_playfile({path} [, {callback}]) + Number play sound file {path} sound_stop({id}) none stop playing sound {id} -sound_stopall() none stop playing all sounds soundfold({word}) String sound-fold {word} spellbadword() String badly spelled word at cursor spellsuggest({word} [, {max} [, {capital}]]) @@ -7360,7 +7360,7 @@ prop_remove({props} [, {lnum} [, {lnum-e not just the first one A property matches when either "id" or "type" matches. If buffer "bufnr" does not exist you get an error message. - If buffer 'bufnr" is not loaded then nothing happens. + If buffer "bufnr" is not loaded then nothing happens. Returns the number of properties that were removed. @@ -8852,6 +8852,10 @@ sort({list} [, {func} [, {dict}]]) *so return a:i1 - a:i2 endfunc < +sound_clear() *sound_clear()* + Stop playing all sounds. + {only available when compiled with the +sound feature} + *sound_playevent()* sound_playevent({name} [, {callback}]) Play a sound identified by {name}. Which event names are @@ -8877,12 +8881,11 @@ sound_playevent({name} [, {callback}]) {only available when compiled with the +sound feature} *sound_playfile()* -sound_playfile({name} [, {callback}]) - Like `sound_playevent()` but play sound file {name}. {name} +sound_playfile({path} [, {callback}]) + Like `sound_playevent()` but play sound file {path}. {path} must be a full path. On Ubuntu you may find files to play with this command: > :!find /usr/share/sounds -type f | grep -v index.theme - < {only available when compiled with the +sound feature} @@ -8891,10 +8894,6 @@ sound_stop({id}) *sound_stop()* `sound_playevent()` or `sound_playfile()`. {only available when compiled with the +sound feature} -sound_stopall() *sound_stopall()* - Stop playing all sounds. - {only available when compiled with the +sound feature} - *soundfold()* soundfold({word}) Return the sound-folded equivalent of {word}. Uses the first @@ -13083,19 +13082,22 @@ Sometimes old syntax of functionality ge When support is taken away this will break older Vim scripts. To make this explicit the |:scriptversion| command can be used. When a Vim script is not compatible with older versions of Vim this will give an explicit error, -instead of failing in mysterious ways. > - +instead of failing in mysterious ways. + + *scriptversion-1* > :scriptversion 1 < This is the original Vim script, same as not using a |:scriptversion| command. Can be used to go back to old syntax for a range of lines. Test for support with: > has('vimscript-1') +< *scriptversion-2* > :scriptversion 2 < String concatenation with "." is not supported, use ".." instead. This avoids the ambiguity using "." for Dict member access and floating point numbers. Now ".5" means the number 0.5. -> + + *scriptversion-3* > :scriptversion 3 < All |vim-variable|s must be prefixed by "v:". E.g. "version" doesn't work as |v:version| anymore, it can be used as a normal variable. diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt --- a/runtime/doc/popup.txt +++ b/runtime/doc/popup.txt @@ -1,4 +1,4 @@ -*popup.txt* For Vim version 8.1. Last change: 2019 Jun 02 +*popup.txt* For Vim version 8.1. Last change: 2019 Jun 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -89,15 +89,18 @@ Probably 2. is the best choice. IMPLEMENTATION: -- Code is in popupwin.c +- buffers remain after popup was deleted. +- do not redraw whole window when popup was changed, mark affected lines for + redraw. - Why does 'nrformats' leak from the popup window buffer??? -- Make redrawing more efficient and avoid flicker. - First draw popups, creating a mask, use the mask in screen_line() when - drawing other windows and stuff. Mask contains zindex of popups. - Keep mask until next update_screen(), use when drawing status lines. - Remove update_popup() calls after draw_tabline()/updating statusline - Fix redrawing problem with completion. - Fix redrawing problem when scrolling non-current window +- Add 'balloonpopup': instead of showing text, let the callback open a balloon + and return the window ID. The popup will then be closed when the mouse + moves, except when it moves inside the popup. +- For the "moved" property also include mouse movement? +- Make redrawing more efficient and avoid flicker: + - put popup menu also put in popup_mask? + - Use changes in popup_mask to decide what windows and range of lines to + redraw? - Disable commands, feedkeys(), CTRL-W, etc. in a popup window. Use NOT_IN_POPUP_WINDOW for more commands. - Invoke filter with character before mapping? @@ -115,6 +118,33 @@ THIS IS UNDER DESIGN - ANYTHING MAY STIL [functions to be moved to eval.txt later, keep overview of functions here] +popup_atcursor({text}, {options}) *popup_atcursor()* + Show the {text} above the cursor, and close it when the cursor + moves. This works like: > + call popup_create({text}, { + \ 'pos': 'botleft', + \ 'line': 'cursor-1', + \ 'col': 'cursor', + \ 'moved': 'WORD', + \ }) +< Use {options} to change the properties. + + + *popup_clear()* +popup_clear() Emergency solution to a misbehaving plugin: close all popup + windows. + + +popup_close({id} [, {result}]) *popup_close()* + Close popup {id}. The window and the associated buffer will + be deleted. + + If the popup has a callback it will be called just before the + popup window is deleted. If the optional {result} is present + it will be passed as the second argument of the callback. + Otherwise zero is passed to the callback. + + popup_create({text}, {options}) *popup_create()* Open a popup window showing {text}, which is either: - a string @@ -133,16 +163,6 @@ popup_create({text}, {options}) *popu < In case of failure zero is returned. -popup_close({id} [, {result}]) *popup_close()* - Close popup {id}. The window and the associated buffer will - be deleted. - - If the popup has a callback it will be called just before the - popup window is deleted. If the optional {result} is present - it will be passed as the second argument of the callback. - Otherwise zero is passed to the callback. - - popup_dialog({text}, {options}) *popup_dialog()* {not implemented yet} Just like |popup_create()| but with these default options: > @@ -155,70 +175,6 @@ popup_dialog({text}, {options}) *popu < Use {options} to change the properties. -popup_notification({text}, {options}) *popup_notification()* - {not implemented yet} - Show the {text} for 3 seconds at the top of the Vim window. - This works like: > - call popup_create({text}, { - \ 'line': 1, - \ 'col': 10, - \ 'time': 3000, - \ 'tab': -1, - \ 'zindex': 200, - \ 'highlight': 'WarningMsg', - \ 'border': [], - \ }) -< Use {options} to change the properties. - - -popup_atcursor({text}, {options}) *popup_atcursor()* - Show the {text} above the cursor, and close it when the cursor - moves. This works like: > - call popup_create({text}, { - \ 'pos': 'botleft', - \ 'line': 'cursor-1', - \ 'col': 'cursor', - \ 'moved': 'WORD', - \ }) -< Use {options} to change the properties. - - -popup_menu({text}, {options}) *popup_menu()* - {not implemented yet} - Show the {text} near the cursor, handle selecting one of the - items with cursorkeys, and close it an item is selected with - Space or Enter. {text} should have multiple lines to make this - useful. This works like: > - call popup_create({text}, { - \ 'pos': 'center', - \ 'zindex': 200, - \ 'wrap': 0, - \ 'border': [], - \ 'filter': 'popup_filter_menu', - \ }) -< Use {options} to change the properties. Should at least set - "callback" to a function that handles the selected item. - - -popup_hide({id}) *popup_hide()* - If {id} is a displayed popup, hide it now. If the popup has a - filter it will not be invoked for so long as the popup is - hidden. - If window {id} does not exist nothing happens. If window {id} - exists but is not a popup window an error is given. *E993* - -popup_show({id}) *popup_show()* - If {id} is a hidden popup, show it now. - For {id} see `popup_hide()`. - -popup_move({id}, {options}) *popup_move()* - Move popup {id} to the position speficied with {options}. - {options} may contain the items from |popup_create()| that - specify the popup position: "line", "col", "pos", "maxheight", - "minheight", "maxwidth" and "minwidth". - For {id} see `popup_hide()`. - - popup_filter_menu({id}, {key}) *popup_filter_menu()* {not implemented yet} Filter that can be used for a popup. It handles the cursor @@ -237,11 +193,6 @@ popup_filter_yesno({id}, {key}) *popu pressing 'n'. -popup_setoptions({id}, {options}) *popup_setoptions()* - {not implemented yet} - Override options in popup {id} with entries in {options}. - - popup_getoptions({id}) *popup_getoptions()* Return the {options} for popup {id} in a Dict. A zero value means the option was not set. For "zindex" the @@ -253,6 +204,7 @@ popup_getoptions({id}) *popup_getopt < If popup window {id} is not found an empty Dict is returned. + popup_getpos({id}) *popup_getpos()* Return the position and size of popup {id}. Returns a Dict with these entries: @@ -274,9 +226,64 @@ popup_getpos({id}) *popup_getpos()* If popup window {id} is not found an empty Dict is returned. - *:popupclear* *:popupc* -:popupc[lear] Emergency solution to a misbehaving plugin: close all popup - windows. +popup_hide({id}) *popup_hide()* + If {id} is a displayed popup, hide it now. If the popup has a + filter it will not be invoked for so long as the popup is + hidden. + If window {id} does not exist nothing happens. If window {id} + exists but is not a popup window an error is given. *E993* + + +popup_menu({text}, {options}) *popup_menu()* + {not implemented yet} + Show the {text} near the cursor, handle selecting one of the + items with cursorkeys, and close it an item is selected with + Space or Enter. {text} should have multiple lines to make this + useful. This works like: > + call popup_create({text}, { + \ 'pos': 'center', + \ 'zindex': 200, + \ 'wrap': 0, + \ 'border': [], + \ 'filter': 'popup_filter_menu', + \ }) +< Use {options} to change the properties. Should at least set + "callback" to a function that handles the selected item. + + +popup_move({id}, {options}) *popup_move()* + Move popup {id} to the position speficied with {options}. + {options} may contain the items from |popup_create()| that + specify the popup position: "line", "col", "pos", "maxheight", + "minheight", "maxwidth" and "minwidth". + For {id} see `popup_hide()`. + + +popup_notification({text}, {options}) *popup_notification()* + {not implemented yet} + Show the {text} for 3 seconds at the top of the Vim window. + This works like: > + call popup_create({text}, { + \ 'line': 1, + \ 'col': 10, + \ 'time': 3000, + \ 'tab': -1, + \ 'zindex': 200, + \ 'highlight': 'WarningMsg', + \ 'border': [], + \ }) +< Use {options} to change the properties. + + +popup_show({id}) *popup_show()* + If {id} is a hidden popup, show it now. + For {id} see `popup_hide()`. + + +popup_setoptions({id}, {options}) *popup_setoptions()* + {not implemented yet} + Override options in popup {id} with entries in {options}. + POPUP BUFFER AND WINDOW *popup-buffer* @@ -405,7 +412,8 @@ The second argument of |popup_create()| By default a double line is used all around when 'encoding' is "utf-8", otherwise ASCII characters are used. - zindex Priority for the popup, default 50. + zindex Priority for the popup, default 50. Mininum value is + 1, maximum value is 32000. time Time in milliseconds after which the popup will close. When omitted |popup_close()| must be used. moved Specifies to close the popup if the cursor moved: @@ -496,7 +504,7 @@ Vim provides standard filters |popup_fil Note that "x" is the normal way to close a popup. You may want to use Esc, but since many keys start with an Esc character, there may be a delay before -Vim recognizes the Esc key. If you do use Esc, it is reecommended to set the +Vim recognizes the Esc key. If you do use Esc, it is recommended to set the 'ttimeoutlen' option to 100 and set 'timeout' and/or 'ttimeout'. diff --git a/src/evalfunc.c b/src/evalfunc.c --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -812,6 +812,7 @@ static struct fst #endif #ifdef FEAT_TEXT_PROP {"popup_atcursor", 2, 2, f_popup_atcursor}, + {"popup_clear", 0, 0, f_popup_clear}, {"popup_close", 1, 2, f_popup_close}, {"popup_create", 2, 2, f_popup_create}, {"popup_getoptions", 1, 1, f_popup_getoptions}, @@ -928,10 +929,10 @@ static struct fst #endif {"sort", 1, 3, f_sort}, #ifdef FEAT_SOUND + {"sound_clear", 0, 0, f_sound_clear}, {"sound_playevent", 1, 2, f_sound_playevent}, {"sound_playfile", 1, 2, f_sound_playfile}, {"sound_stop", 1, 1, f_sound_stop}, - {"sound_stopall", 0, 0, f_sound_stopall}, #endif {"soundfold", 1, 1, f_soundfold}, {"spellbadword", 0, 1, f_spellbadword}, diff --git a/src/ex_cmdidxs.h b/src/ex_cmdidxs.h --- a/src/ex_cmdidxs.h +++ b/src/ex_cmdidxs.h @@ -21,16 +21,16 @@ static const unsigned short cmdidxs1[26] /* n */ 285, /* o */ 305, /* p */ 317, - /* q */ 357, - /* r */ 360, - /* s */ 380, - /* t */ 448, - /* u */ 493, - /* v */ 504, - /* w */ 522, - /* x */ 536, - /* y */ 546, - /* z */ 547 + /* q */ 356, + /* r */ 359, + /* s */ 379, + /* t */ 447, + /* u */ 492, + /* v */ 503, + /* w */ 521, + /* x */ 535, + /* y */ 545, + /* z */ 546 }; /* @@ -56,7 +56,7 @@ static const unsigned char cmdidxs2[26][ /* m */ { 1, 0, 0, 0, 7, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 }, /* n */ { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 10, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0 }, /* o */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 5, 0, 0, 0, 0, 0, 0, 9, 0, 11, 0, 0, 0 }, - /* p */ { 1, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 10, 0, 0, 17, 18, 27, 0, 28, 0, 29, 0 }, + /* p */ { 1, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 0, 0, 16, 17, 26, 0, 27, 0, 28, 0 }, /* q */ { 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* r */ { 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 19, 0, 0, 0, 0 }, /* s */ { 2, 6, 15, 0, 19, 23, 0, 25, 26, 0, 0, 29, 31, 35, 39, 41, 0, 49, 0, 50, 0, 62, 63, 0, 64, 0 }, @@ -69,4 +69,4 @@ static const unsigned char cmdidxs2[26][ /* z */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; -static const int command_count = 560; +static const int command_count = 559; diff --git a/src/ex_cmds.h b/src/ex_cmds.h --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -1091,9 +1091,6 @@ EX(CMD_pop, "pop", ex_tag, EX(CMD_popup, "popup", ex_popup, NEEDARG|EXTRA|BANG|TRLBAR|NOTRLCOM|CMDWIN, ADDR_NONE), -EX(CMD_popupclear, "popupclear", ex_popupclear, - TRLBAR, - ADDR_NONE), EX(CMD_ppop, "ppop", ex_ptag, RANGE|BANG|COUNT|TRLBAR|ZEROR, ADDR_OTHER), diff --git a/src/popupwin.c b/src/popupwin.c --- a/src/popupwin.c +++ b/src/popupwin.c @@ -711,6 +711,15 @@ popup_create(typval_T *argvars, typval_T } /* + * popup_clear() + */ + void +f_popup_clear(typval_T *argvars UNUSED, typval_T *rettv UNUSED) +{ + close_all_popups(); +} + +/* * popup_create({text}, {options}) */ void @@ -928,12 +937,6 @@ close_all_popups(void) popup_close(curtab->tp_first_popupwin->w_id); } - void -ex_popupclear(exarg_T *eap UNUSED) -{ - close_all_popups(); -} - /* * popup_move({id}, {options}) */ diff --git a/src/proto/popupwin.pro b/src/proto/popupwin.pro --- a/src/proto/popupwin.pro +++ b/src/proto/popupwin.pro @@ -1,5 +1,6 @@ /* popupwin.c */ void popup_adjust_position(win_T *wp); +void f_popup_clear(typval_T *argvars, typval_T *rettv); void f_popup_create(typval_T *argvars, typval_T *rettv); void f_popup_atcursor(typval_T *argvars, typval_T *rettv); int popup_any_visible(void); @@ -9,7 +10,6 @@ void f_popup_show(typval_T *argvars, typ void popup_close(int id); void popup_close_tabpage(tabpage_T *tp, int id); void close_all_popups(void); -void ex_popupclear(exarg_T *eap); void f_popup_move(typval_T *argvars, typval_T *rettv); void f_popup_getpos(typval_T *argvars, typval_T *rettv); void f_popup_getoptions(typval_T *argvars, typval_T *rettv); diff --git a/src/proto/sound.pro b/src/proto/sound.pro --- a/src/proto/sound.pro +++ b/src/proto/sound.pro @@ -2,6 +2,6 @@ void f_sound_playevent(typval_T *argvars, typval_T *rettv); void f_sound_playfile(typval_T *argvars, typval_T *rettv); void f_sound_stop(typval_T *argvars, typval_T *rettv); -void f_sound_stopall(typval_T *argvars, typval_T *rettv); +void f_sound_clear(typval_T *argvars, typval_T *rettv); void sound_free(void); /* vim: set ft=c : */ diff --git a/src/sound.c b/src/sound.c --- a/src/sound.c +++ b/src/sound.c @@ -156,12 +156,18 @@ f_sound_playevent(typval_T *argvars, typ sound_play_common(argvars, rettv, FALSE); } +/* + * implementation of sound_playfile({path} [, {callback}]) + */ void f_sound_playfile(typval_T *argvars, typval_T *rettv) { sound_play_common(argvars, rettv, TRUE); } +/* + * implementation of sound_stop({id}) + */ void f_sound_stop(typval_T *argvars, typval_T *rettv UNUSED) { @@ -169,8 +175,11 @@ f_sound_stop(typval_T *argvars, typval_T ca_context_cancel(context, tv_get_number(&argvars[0])); } +/* + * implementation of sound_clear() + */ void -f_sound_stopall(typval_T *argvars UNUSED, typval_T *rettv UNUSED) +f_sound_clear(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { if (context != NULL) { diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -61,7 +61,7 @@ func Test_simple_popup() call term_wait(buf) call term_sendkeys(buf, "0") call term_wait(buf) - call term_sendkeys(buf, ":popupclear\") + call term_sendkeys(buf, ":call popup_clear()\") call VerifyScreenDump(buf, 'Test_popupwin_08', {}) " clean up @@ -271,7 +271,7 @@ func Test_popup_in_tab() call assert_equal(0, popup_getpos(winid).visible) quit call assert_equal(1, popup_getpos(winid).visible) - popupclear + call popup_clear() " global popup is visible in any tab let winid = popup_create("text", {'tab': -1}) @@ -280,7 +280,7 @@ func Test_popup_in_tab() call assert_equal(1, popup_getpos(winid).visible) quit call assert_equal(1, popup_getpos(winid).visible) - popupclear + call popup_clear() endfunc func Test_popup_valid_arguments() @@ -288,13 +288,13 @@ func Test_popup_valid_arguments() let winid = popup_create("text", {"col": 0}) let pos = popup_getpos(winid) call assert_inrange(&columns / 2 - 1, &columns / 2 + 1, pos.col) - popupclear + call popup_clear() " using cursor column has minimum value of 1 let winid = popup_create("text", {"col": 'cursor-100'}) let pos = popup_getpos(winid) call assert_equal(1, pos.col) - popupclear + call popup_clear() " center let winid = popup_create("text", {"pos": 'center'}) @@ -303,57 +303,57 @@ func Test_popup_valid_arguments() call assert_inrange(around - 1, around + 1, pos.col) let around = (&lines - pos.height) / 2 call assert_inrange(around - 1, around + 1, pos.line) - popupclear + call popup_clear() endfunc func Test_popup_invalid_arguments() call assert_fails('call popup_create(666, {})', 'E714:') - popupclear + call popup_clear() call assert_fails('call popup_create("text", "none")', 'E715:') - popupclear + call popup_clear() call assert_fails('call popup_create("text", {"col": "xxx"})', 'E475:') - popupclear + call popup_clear() call assert_fails('call popup_create("text", {"col": "cursor8"})', 'E15:') - popupclear + call popup_clear() call assert_fails('call popup_create("text", {"col": "cursor+x"})', 'E15:') - popupclear + call popup_clear() call assert_fails('call popup_create("text", {"col": "cursor+8x"})', 'E15:') - popupclear + call popup_clear() call assert_fails('call popup_create("text", {"line": "xxx"})', 'E475:') - popupclear + call popup_clear() call assert_fails('call popup_create("text", {"line": "cursor8"})', 'E15:') - popupclear + call popup_clear() call assert_fails('call popup_create("text", {"line": "cursor+x"})', 'E15:') - popupclear + call popup_clear() call assert_fails('call popup_create("text", {"line": "cursor+8x"})', 'E15:') - popupclear + call popup_clear() call assert_fails('call popup_create("text", {"pos": "there"})', 'E475:') - popupclear + call popup_clear() call assert_fails('call popup_create("text", {"padding": "none"})', 'E714:') - popupclear + call popup_clear() call assert_fails('call popup_create("text", {"border": "none"})', 'E714:') - popupclear + call popup_clear() call assert_fails('call popup_create("text", {"borderhighlight": "none"})', 'E714:') - popupclear + call popup_clear() call assert_fails('call popup_create("text", {"borderchars": "none"})', 'E714:') - popupclear + call popup_clear() call assert_fails('call popup_create([{"text": "text"}, 666], {})', 'E715:') - popupclear + call popup_clear() call assert_fails('call popup_create([{"text": "text", "props": "none"}], {})', 'E714:') - popupclear + call popup_clear() call assert_fails('call popup_create([{"text": "text", "props": ["none"]}], {})', 'E715:') - popupclear + call popup_clear() endfunc func Test_win_execute_closing_curwin() split let winid = popup_create('some text', {}) call assert_fails('call win_execute(winid, winnr() .. "close")', 'E994') - popupclear + call popup_clear() endfunc func Test_win_execute_not_allowed() @@ -374,7 +374,7 @@ func Test_win_execute_not_allowed() call assert_fails('call win_execute(winid, "wincmd w")', 'E994:') call assert_fails('call win_execute(winid, "wincmd t")', 'E994:') call assert_fails('call win_execute(winid, "wincmd b")', 'E994:') - popupclear + call popup_clear() endfunc func Test_popup_with_wrap() @@ -770,7 +770,7 @@ func Test_popup_filter() call assert_equal(-1, winbufnr(winid)) delfunc MyPopupFilter - popupclear + call popup_clear() endfunc func Test_popup_close_callback() @@ -944,7 +944,7 @@ func Test_popup_position_adjust() endfor endfor - popupclear + call popup_clear() %bwipe! endfunc @@ -1010,7 +1010,7 @@ func Test_adjust_left_past_screen_width( call popup_close( p ) redraw - popupclear + call popup_clear() %bwipe! endfunc @@ -1026,7 +1026,7 @@ func Test_popup_moved() " trigger the check for last_cursormoved by going into insert mode call feedkeys("li\", 'xt') call assert_equal({}, popup_getpos(winid)) - popupclear + call popup_clear() exe "normal gg0/word\" let winid = popup_atcursor('text', {'moved': 'word'}) @@ -1034,7 +1034,7 @@ func Test_popup_moved() call assert_equal(1, popup_getpos(winid).visible) call feedkeys("hi\", 'xt') call assert_equal({}, popup_getpos(winid)) - popupclear + call popup_clear() exe "normal gg0/word\" let winid = popup_atcursor('text', {'moved': 'word'}) @@ -1046,7 +1046,7 @@ func Test_popup_moved() call assert_equal(1, popup_getpos(winid).visible) call feedkeys("eli\", 'xt') call assert_equal({}, popup_getpos(winid)) - popupclear + call popup_clear() " WORD is the default exe "normal gg0/WORD\" @@ -1059,7 +1059,7 @@ func Test_popup_moved() call assert_equal(1, popup_getpos(winid).visible) call feedkeys("Eli\", 'xt') call assert_equal({}, popup_getpos(winid)) - popupclear + call popup_clear() exe "normal gg0/word\" let winid = popup_atcursor('text', {'moved': [5, 10]}) @@ -1070,7 +1070,7 @@ func Test_popup_moved() call assert_equal(1, popup_getpos(winid).visible) call feedkeys("eli\", 'xt') call assert_equal({}, popup_getpos(winid)) - popupclear + call popup_clear() bwipe! call test_override('ALL', 0) diff --git a/src/testdir/test_sound.vim b/src/testdir/test_sound.vim --- a/src/testdir/test_sound.vim +++ b/src/testdir/test_sound.vim @@ -41,7 +41,7 @@ func Test_play_silent() let id2 = sound_playfile(fname, 'PlayCallback') call assert_true(id2 > 0) sleep 20m - call sound_stopall() + call sound_clear() call assert_equal(id2, g:id) call assert_equal(1, g:result) endfunc diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -778,6 +778,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1513, +/**/ 1512, /**/ 1511,