diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-07-25 19:35:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-25 19:35:23 +0200 |
commit | 192adfe99f33778a85e11fbfdceb37f347a3d235 (patch) | |
tree | 529e922ff73a8907df3538ac25f0efb685348f6b /src/nvim/ex_cmds.c | |
parent | f15c74550252a553eaecb3f55af60d7f7ae27540 (diff) | |
parent | 8ce092941862a18a6591f62f398ed9e8bd9202be (diff) | |
download | rneovim-192adfe99f33778a85e11fbfdceb37f347a3d235.tar.gz rneovim-192adfe99f33778a85e11fbfdceb37f347a3d235.tar.bz2 rneovim-192adfe99f33778a85e11fbfdceb37f347a3d235.zip |
Merge pull request #14311 from matveyt/nomode_ce
refactor(state): Remove EXMODE_NORMAL
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 0e7d7c2dc2..dc096bdb93 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -2887,7 +2887,6 @@ void ex_append(exarg_T *eap) } else if (lnum > 0) indent = get_indent_lnum(lnum); } - ex_keep_indent = FALSE; if (eap->getline == NULL) { /* No getline() function, use the lines that follow. This ends * when there is no more. */ @@ -2915,10 +2914,6 @@ void ex_append(exarg_T *eap) if (theline == NULL) break; - /* Using ^ CTRL-D in getexmodeline() makes us repeat the indent. */ - if (ex_keep_indent) - append_indent = indent; - /* Look for the "." after automatic indent. */ vcol = 0; for (p = theline; indent > vcol; ++p) { @@ -3751,6 +3746,7 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout, */ while (subflags.do_ask) { if (exmode_active) { + char *prompt; char_u *resp; colnr_T sc, ec; @@ -3767,13 +3763,14 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout, sc += numw; ec += numw; } - msg_start(); - for (i = 0; i < (long)sc; ++i) - msg_putchar(' '); - for (; i <= (long)ec; ++i) - msg_putchar('^'); - resp = getexmodeline('?', NULL, 0, true); + prompt = xmallocz(ec + 1); + memset(prompt, ' ', sc); + memset(prompt + sc, '^', ec - sc + 1); + resp = (char_u *)getcmdline_prompt(NUL, prompt, 0, EXPAND_NOTHING, + NULL, CALLBACK_NONE); + msg_putchar('\n'); + xfree(prompt); if (resp != NULL) { typed = *resp; xfree(resp); |