To: vim_dev@googlegroups.com Subject: Patch 8.1.1513 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1513 Problem: All popup functionality is in functions, except :popupclear. Solution: Add popup_clear() for consistency. Also rename sound_stopall() to sound_clear(). Files: src/ex_cmds.h, src/ex_cmdidxs.h, src/evalfunc.c, src/popupwin.c, src/proto/popupwin.pro, src/sound.c, src/proto/sound.pro, src/testdir/test_popupwin.vim src/testdir/test_sound.vim, runtime/doc/eval.txt runtime/doc/popup.txt *** ../vim-8.1.1512/src/ex_cmds.h 2019-05-25 19:51:03.772408479 +0200 --- src/ex_cmds.h 2019-06-09 22:48:23.421225769 +0200 *************** *** 1091,1099 **** 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), --- 1091,1096 ---- *** ../vim-8.1.1512/src/ex_cmdidxs.h 2019-05-25 19:51:03.772408479 +0200 --- src/ex_cmdidxs.h 2019-06-09 22:53:44.051400362 +0200 *************** *** 21,36 **** /* 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 }; /* --- 21,36 ---- /* n */ 285, /* o */ 305, /* p */ 317, ! /* q */ 356, ! /* r */ 359, ! /* s */ 379, ! /* t */ 447, ! /* u */ 492, ! /* v */ 503, ! /* w */ 521, ! /* x */ 535, ! /* y */ 545, ! /* z */ 546 }; /* *************** *** 56,62 **** /* 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 }, /* 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 }, --- 56,62 ---- /* 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, 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,72 **** /* 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; --- 69,72 ---- /* 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 = 559; *** ../vim-8.1.1512/src/evalfunc.c 2019-06-09 17:21:48.657261063 +0200 --- src/evalfunc.c 2019-06-10 12:58:32.222534524 +0200 *************** *** 812,817 **** --- 812,818 ---- #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,937 **** #endif {"sort", 1, 3, f_sort}, #ifdef FEAT_SOUND {"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}, --- 929,938 ---- #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}, #endif {"soundfold", 1, 1, f_soundfold}, {"spellbadword", 0, 1, f_spellbadword}, *** ../vim-8.1.1512/src/popupwin.c 2019-06-08 17:15:47.671568076 +0200 --- src/popupwin.c 2019-06-09 22:51:14.901825120 +0200 *************** *** 711,716 **** --- 711,725 ---- } /* + * popup_clear() + */ + void + f_popup_clear(typval_T *argvars UNUSED, typval_T *rettv UNUSED) + { + close_all_popups(); + } + + /* * popup_create({text}, {options}) */ void *************** *** 928,939 **** popup_close(curtab->tp_first_popupwin->w_id); } - void - ex_popupclear(exarg_T *eap UNUSED) - { - close_all_popups(); - } - /* * popup_move({id}, {options}) */ --- 937,942 ---- *** ../vim-8.1.1512/src/proto/popupwin.pro 2019-06-02 18:40:02.641508815 +0200 --- src/proto/popupwin.pro 2019-06-09 22:51:26.397622667 +0200 *************** *** 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,15 **** 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); --- 10,15 ---- *** ../vim-8.1.1512/src/sound.c 2019-06-09 13:42:36.424522190 +0200 --- src/sound.c 2019-06-10 13:00:49.829685197 +0200 *************** *** 156,167 **** --- 156,173 ---- 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,176 **** ca_context_cancel(context, tv_get_number(&argvars[0])); } void ! f_sound_stopall(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { if (context != NULL) { --- 175,185 ---- ca_context_cancel(context, tv_get_number(&argvars[0])); } + /* + * implementation of sound_clear() + */ void ! f_sound_clear(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { if (context != NULL) { *** ../vim-8.1.1512/src/proto/sound.pro 2019-06-09 13:42:36.424522190 +0200 --- src/proto/sound.pro 2019-06-10 13:04:30.044454759 +0200 *************** *** 2,7 **** 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 sound_free(void); /* vim: set ft=c : */ --- 2,7 ---- 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_clear(typval_T *argvars, typval_T *rettv); void sound_free(void); /* vim: set ft=c : */ *** ../vim-8.1.1512/src/testdir/test_popupwin.vim 2019-06-09 18:04:09.839426999 +0200 --- src/testdir/test_popupwin.vim 2019-06-09 22:52:48.956247768 +0200 *************** *** 61,67 **** call term_wait(buf) call term_sendkeys(buf, "0") call term_wait(buf) ! call term_sendkeys(buf, ":popupclear\") call VerifyScreenDump(buf, 'Test_popupwin_08', {}) " clean up --- 61,67 ---- call term_wait(buf) call term_sendkeys(buf, "0") call term_wait(buf) ! call term_sendkeys(buf, ":call popup_clear()\") call VerifyScreenDump(buf, 'Test_popupwin_08', {}) " clean up *************** *** 271,277 **** call assert_equal(0, popup_getpos(winid).visible) quit call assert_equal(1, popup_getpos(winid).visible) ! popupclear " global popup is visible in any tab let winid = popup_create("text", {'tab': -1}) --- 271,277 ---- call assert_equal(0, popup_getpos(winid).visible) quit call assert_equal(1, popup_getpos(winid).visible) ! call popup_clear() " global popup is visible in any tab let winid = popup_create("text", {'tab': -1}) *************** *** 280,286 **** call assert_equal(1, popup_getpos(winid).visible) quit call assert_equal(1, popup_getpos(winid).visible) ! popupclear endfunc func Test_popup_valid_arguments() --- 280,286 ---- call assert_equal(1, popup_getpos(winid).visible) quit call assert_equal(1, popup_getpos(winid).visible) ! call popup_clear() endfunc func Test_popup_valid_arguments() *************** *** 288,300 **** let winid = popup_create("text", {"col": 0}) let pos = popup_getpos(winid) call assert_inrange(&columns / 2 - 1, &columns / 2 + 1, pos.col) ! popupclear " 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 " center let winid = popup_create("text", {"pos": 'center'}) --- 288,300 ---- let winid = popup_create("text", {"col": 0}) let pos = popup_getpos(winid) call assert_inrange(&columns / 2 - 1, &columns / 2 + 1, pos.col) ! 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) ! call popup_clear() " center let winid = popup_create("text", {"pos": 'center'}) *************** *** 303,359 **** 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 endfunc func Test_popup_invalid_arguments() call assert_fails('call popup_create(666, {})', 'E714:') ! popupclear call assert_fails('call popup_create("text", "none")', 'E715:') ! popupclear call assert_fails('call popup_create("text", {"col": "xxx"})', 'E475:') ! popupclear call assert_fails('call popup_create("text", {"col": "cursor8"})', 'E15:') ! popupclear call assert_fails('call popup_create("text", {"col": "cursor+x"})', 'E15:') ! popupclear call assert_fails('call popup_create("text", {"col": "cursor+8x"})', 'E15:') ! popupclear call assert_fails('call popup_create("text", {"line": "xxx"})', 'E475:') ! popupclear call assert_fails('call popup_create("text", {"line": "cursor8"})', 'E15:') ! popupclear call assert_fails('call popup_create("text", {"line": "cursor+x"})', 'E15:') ! popupclear call assert_fails('call popup_create("text", {"line": "cursor+8x"})', 'E15:') ! popupclear call assert_fails('call popup_create("text", {"pos": "there"})', 'E475:') ! popupclear call assert_fails('call popup_create("text", {"padding": "none"})', 'E714:') ! popupclear call assert_fails('call popup_create("text", {"border": "none"})', 'E714:') ! popupclear call assert_fails('call popup_create("text", {"borderhighlight": "none"})', 'E714:') ! popupclear call assert_fails('call popup_create("text", {"borderchars": "none"})', 'E714:') ! popupclear call assert_fails('call popup_create([{"text": "text"}, 666], {})', 'E715:') ! popupclear call assert_fails('call popup_create([{"text": "text", "props": "none"}], {})', 'E714:') ! popupclear call assert_fails('call popup_create([{"text": "text", "props": ["none"]}], {})', 'E715:') ! popupclear 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 endfunc func Test_win_execute_not_allowed() --- 303,359 ---- call assert_inrange(around - 1, around + 1, pos.col) let around = (&lines - pos.height) / 2 call assert_inrange(around - 1, around + 1, pos.line) ! call popup_clear() endfunc func Test_popup_invalid_arguments() call assert_fails('call popup_create(666, {})', 'E714:') ! call popup_clear() call assert_fails('call popup_create("text", "none")', 'E715:') ! call popup_clear() call assert_fails('call popup_create("text", {"col": "xxx"})', 'E475:') ! call popup_clear() call assert_fails('call popup_create("text", {"col": "cursor8"})', 'E15:') ! call popup_clear() call assert_fails('call popup_create("text", {"col": "cursor+x"})', 'E15:') ! call popup_clear() call assert_fails('call popup_create("text", {"col": "cursor+8x"})', 'E15:') ! call popup_clear() call assert_fails('call popup_create("text", {"line": "xxx"})', 'E475:') ! call popup_clear() call assert_fails('call popup_create("text", {"line": "cursor8"})', 'E15:') ! call popup_clear() call assert_fails('call popup_create("text", {"line": "cursor+x"})', 'E15:') ! call popup_clear() call assert_fails('call popup_create("text", {"line": "cursor+8x"})', 'E15:') ! call popup_clear() call assert_fails('call popup_create("text", {"pos": "there"})', 'E475:') ! call popup_clear() call assert_fails('call popup_create("text", {"padding": "none"})', 'E714:') ! call popup_clear() call assert_fails('call popup_create("text", {"border": "none"})', 'E714:') ! call popup_clear() call assert_fails('call popup_create("text", {"borderhighlight": "none"})', 'E714:') ! call popup_clear() call assert_fails('call popup_create("text", {"borderchars": "none"})', 'E714:') ! call popup_clear() call assert_fails('call popup_create([{"text": "text"}, 666], {})', 'E715:') ! call popup_clear() call assert_fails('call popup_create([{"text": "text", "props": "none"}], {})', 'E714:') ! call popup_clear() call assert_fails('call popup_create([{"text": "text", "props": ["none"]}], {})', 'E715:') ! 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') ! call popup_clear() endfunc func Test_win_execute_not_allowed() *************** *** 374,380 **** 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 endfunc func Test_popup_with_wrap() --- 374,380 ---- 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:') ! call popup_clear() endfunc func Test_popup_with_wrap() *************** *** 770,776 **** call assert_equal(-1, winbufnr(winid)) delfunc MyPopupFilter ! popupclear endfunc func Test_popup_close_callback() --- 770,776 ---- call assert_equal(-1, winbufnr(winid)) delfunc MyPopupFilter ! call popup_clear() endfunc func Test_popup_close_callback() *************** *** 944,950 **** endfor endfor ! popupclear %bwipe! endfunc --- 944,950 ---- endfor endfor ! call popup_clear() %bwipe! endfunc *************** *** 1010,1016 **** call popup_close( p ) redraw ! popupclear %bwipe! endfunc --- 1010,1016 ---- call popup_close( p ) redraw ! call popup_clear() %bwipe! endfunc *************** *** 1026,1032 **** " trigger the check for last_cursormoved by going into insert mode call feedkeys("li\", 'xt') call assert_equal({}, popup_getpos(winid)) ! popupclear exe "normal gg0/word\" let winid = popup_atcursor('text', {'moved': 'word'}) --- 1026,1032 ---- " trigger the check for last_cursormoved by going into insert mode call feedkeys("li\", 'xt') call assert_equal({}, popup_getpos(winid)) ! call popup_clear() exe "normal gg0/word\" let winid = popup_atcursor('text', {'moved': 'word'}) *************** *** 1034,1040 **** call assert_equal(1, popup_getpos(winid).visible) call feedkeys("hi\", 'xt') call assert_equal({}, popup_getpos(winid)) ! popupclear exe "normal gg0/word\" let winid = popup_atcursor('text', {'moved': 'word'}) --- 1034,1040 ---- call assert_equal(1, popup_getpos(winid).visible) call feedkeys("hi\", 'xt') call assert_equal({}, popup_getpos(winid)) ! call popup_clear() exe "normal gg0/word\" let winid = popup_atcursor('text', {'moved': 'word'}) *************** *** 1046,1052 **** call assert_equal(1, popup_getpos(winid).visible) call feedkeys("eli\", 'xt') call assert_equal({}, popup_getpos(winid)) ! popupclear " WORD is the default exe "normal gg0/WORD\" --- 1046,1052 ---- call assert_equal(1, popup_getpos(winid).visible) call feedkeys("eli\", 'xt') call assert_equal({}, popup_getpos(winid)) ! call popup_clear() " WORD is the default exe "normal gg0/WORD\" *************** *** 1059,1065 **** call assert_equal(1, popup_getpos(winid).visible) call feedkeys("Eli\", 'xt') call assert_equal({}, popup_getpos(winid)) ! popupclear exe "normal gg0/word\" let winid = popup_atcursor('text', {'moved': [5, 10]}) --- 1059,1065 ---- call assert_equal(1, popup_getpos(winid).visible) call feedkeys("Eli\", 'xt') call assert_equal({}, popup_getpos(winid)) ! call popup_clear() exe "normal gg0/word\" let winid = popup_atcursor('text', {'moved': [5, 10]}) *************** *** 1070,1076 **** call assert_equal(1, popup_getpos(winid).visible) call feedkeys("eli\", 'xt') call assert_equal({}, popup_getpos(winid)) ! popupclear bwipe! call test_override('ALL', 0) --- 1070,1076 ---- call assert_equal(1, popup_getpos(winid).visible) call feedkeys("eli\", 'xt') call assert_equal({}, popup_getpos(winid)) ! call popup_clear() bwipe! call test_override('ALL', 0) *** ../vim-8.1.1512/src/testdir/test_sound.vim 2019-06-09 15:35:38.539101807 +0200 --- src/testdir/test_sound.vim 2019-06-10 13:04:26.348474383 +0200 *************** *** 41,47 **** let id2 = sound_playfile(fname, 'PlayCallback') call assert_true(id2 > 0) sleep 20m ! call sound_stopall() call assert_equal(id2, g:id) call assert_equal(1, g:result) endfunc --- 41,47 ---- let id2 = sound_playfile(fname, 'PlayCallback') call assert_true(id2 > 0) sleep 20m ! call sound_clear() call assert_equal(id2, g:id) call assert_equal(1, g:result) endfunc *** ../vim-8.1.1512/runtime/doc/eval.txt 2019-06-09 17:21:48.653261084 +0200 --- runtime/doc/eval.txt 2019-06-10 13:02:08.741228564 +0200 *************** *** 2622,2633 **** sinh({expr}) Float hyperbolic sine of {expr} sort({list} [, {func} [, {dict}]]) List sort {list}, using {func} to compare sound_playevent({name} [, {callback}]) Number play an event sound ! sound_playfile({name} [, {callback}]) ! Number play a sound file 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}]]) --- 2623,2634 ---- 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({path} [, {callback}]) ! Number play sound file {path} sound_stop({id}) none stop playing sound {id} soundfold({word}) String sound-fold {word} spellbadword() String badly spelled word at cursor spellsuggest({word} [, {max} [, {capital}]]) *************** *** 8851,8856 **** --- 8852,8861 ---- 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 *************** *** 8876,8887 **** {only available when compiled with the +sound feature} *sound_playfile()* ! sound_playfile({name} [, {callback}]) ! Like `sound_playevent()` but play sound file {name}. {name} 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} --- 8881,8891 ---- {only available when compiled with the +sound feature} *sound_playfile()* ! 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} *************** *** 8890,8899 **** `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 --- 8894,8899 ---- *************** *** 10392,10397 **** --- 10393,10400 ---- call win_execute(winid, 'set syntax=python') < Doing the same with `setwinvar()` would not trigger autocommands and not actually show syntax highlighting. + *E994* + Not all commands are allowed in popup windows. win_findbuf({bufnr}) *win_findbuf()* Returns a list with |window-ID|s for windows that contain *** ../vim-8.1.1512/runtime/doc/popup.txt 2019-06-02 18:40:02.641508815 +0200 --- runtime/doc/popup.txt 2019-06-09 22:58:39.059589678 +0200 *************** *** 89,103 **** IMPLEMENTATION: ! - Code is in popupwin.c - 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 - Disable commands, feedkeys(), CTRL-W, etc. in a popup window. Use NOT_IN_POPUP_WINDOW for more commands. - Invoke filter with character before mapping? --- 89,106 ---- IMPLEMENTATION: ! - 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??? ! - 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,120 **** --- 118,150 ---- [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,148 **** < 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: > --- 163,168 ---- *************** *** 155,225 **** < 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()* - {not implemented yet: close when cursor moves} - 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 --- 175,180 ---- *************** *** 238,248 **** 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 --- 193,198 ---- *************** *** 254,259 **** --- 204,210 ---- < 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: *************** *** 275,283 **** 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 BUFFER AND WINDOW *popup-buffer* --- 226,289 ---- If popup window {id} is not found an empty Dict is returned. ! 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* *************** *** 406,412 **** 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. 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: --- 412,419 ---- 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. 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: *************** *** 497,503 **** 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 'ttimeoutlen' option to 100 and set 'timeout' and/or 'ttimeout'. --- 504,510 ---- 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 recommended to set the 'ttimeoutlen' option to 100 and set 'timeout' and/or 'ttimeout'. *** ../vim-8.1.1512/src/version.c 2019-06-09 19:51:54.472551622 +0200 --- src/version.c 2019-06-09 23:09:15.853690027 +0200 *************** *** 779,780 **** --- 779,782 ---- { /* Add new patch number below this line */ + /**/ + 1513, /**/ -- hundred-and-one symptoms of being an internet addict: 140. You'd rather catch a score on the web than watch the game as it is being played on tv. /// 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 ///