Skip to content

Commit 04f5446

Browse files
committed
updated for version 7.3.598
Problem: Cannot act upon end of completion. (Taro Muraoka) Solution: Add an autocommand event that is triggered when completion has finished. (Idea by Florian Klein)
1 parent 0846e43 commit 04f5446

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

src/edit.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3823,6 +3823,11 @@ ins_compl_prep(c)
38233823
*/
38243824
if (want_cindent && in_cinkeys(KEY_COMPLETE, ' ', inindent(0)))
38253825
do_c_expr_indent();
3826+
#endif
3827+
#ifdef FEAT_AUTOCMD
3828+
/* Trigger the CompleteDone event to give scripts a chance to act
3829+
* upon the completion. */
3830+
apply_autocmds(EVENT_COMPLETEDONE, NULL, NULL, FALSE, curbuf);
38263831
#endif
38273832
}
38283833
}

src/fileio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7643,6 +7643,7 @@ static struct event_name
76437643
{"CmdwinEnter", EVENT_CMDWINENTER},
76447644
{"CmdwinLeave", EVENT_CMDWINLEAVE},
76457645
{"ColorScheme", EVENT_COLORSCHEME},
7646+
{"CompleteDone", EVENT_COMPLETEDONE},
76467647
{"CursorHold", EVENT_CURSORHOLD},
76477648
{"CursorHoldI", EVENT_CURSORHOLDI},
76487649
{"CursorMoved", EVENT_CURSORMOVED},

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,8 @@ static char *(features[]) =
714714

715715
static int included_patches[] =
716716
{ /* Add new patch number below this line */
717+
/**/
718+
598,
717719
/**/
718720
597,
719721
/**/

src/vim.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,7 @@ enum auto_event
12411241
EVENT_CMDWINENTER, /* after entering the cmdline window */
12421242
EVENT_CMDWINLEAVE, /* before leaving the cmdline window */
12431243
EVENT_COLORSCHEME, /* after loading a colorscheme */
1244+
EVENT_COMPLETEDONE, /* after finishing insert complete */
12441245
EVENT_FILEAPPENDPOST, /* after appending to a file */
12451246
EVENT_FILEAPPENDPRE, /* before appending to a file */
12461247
EVENT_FILEAPPENDCMD, /* append to a file using command */

0 commit comments

Comments
 (0)