diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-11-09 03:19:22 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-11-09 03:19:22 +0100 |
commit | 0213e99aaf6eba303fd459183dd14a4a11cc5b07 (patch) | |
tree | 9cf382b3ac1922520f9934cf47887430d99bc023 /src/nvim/ex_getln.c | |
parent | bd33f1165b95e9f8f0d20ae3a941ee55906107ee (diff) | |
parent | aa0e09d251610f9b17f0bf96a4f3485032c36e0f (diff) | |
download | rneovim-0213e99aaf6eba303fd459183dd14a4a11cc5b07.tar.gz rneovim-0213e99aaf6eba303fd459183dd14a4a11cc5b07.tar.bz2 rneovim-0213e99aaf6eba303fd459183dd14a4a11cc5b07.zip |
Merge #5561 'inccommand'
Initial work by:
Robin Elrharbi-Fleury (Robinhola)
Audrey Rayé (Adrey06)
Philémon Hullot (DesbyP)
Aymeric Collange (aym7)
Clément Guyomard (Clement0)
Major revisions by:
KillTheMule
Björn Linse <bjorn.linse@gmail.com>
Justin M. Keyes <justinkz@gmail.com>
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index e525c949bd..17693ecfc8 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1591,6 +1591,15 @@ static int command_line_changed(CommandLineState *s) msg_starthere(); redrawcmdline(); s->did_incsearch = true; + } else if (s->firstc == ':' + && KeyTyped // only if interactive + && *p_icm != NUL // 'inccommand' is set + && curbuf->b_p_ma // buffer is modifiable + && cmdline_star == 0 // not typing a password + && cmd_is_live(ccline.cmdbuff)) { + // process a "live" command ('inccommand') + do_cmdline(ccline.cmdbuff, NULL, NULL, DOCMD_KEEPLINE|DOCMD_LIVE); + redrawcmdline(); } if (cmdmsg_rl || (p_arshape && !p_tbidi && enc_utf8)) { @@ -5137,16 +5146,12 @@ static int ex_window(void) } cmdwin_type = get_cmdline_type(); - /* Create the command-line buffer empty. */ - (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL); - (void)setfname(curbuf, (char_u *)"[Command Line]", NULL, TRUE); - set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL); - set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL); - curbuf->b_p_ma = TRUE; - curwin->w_p_fen = FALSE; + // Create empty command-line buffer. + buf_open_special(0, "[Command Line]", "nofile"); curwin->w_p_rl = cmdmsg_rl; - cmdmsg_rl = FALSE; - RESET_BINDING(curwin); + cmdmsg_rl = false; + curbuf->b_p_ma = true; + curwin->w_p_fen = false; /* Do execute autocommands for setting the filetype (load syntax). */ unblock_autocmds(); |