aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorDongdong Zhou <dzhou121@gmail.com>2017-04-28 06:51:16 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2017-10-26 09:35:12 +0200
commit550651c130c014e6c668644273db31dd96be475e (patch)
treee3723a1101e6e1648e1d7fa526d92b9e7904458c /src/nvim/eval.c
parentb7a8a76f6e3b2de1cfdf32e3ccc66d87ab8e5cad (diff)
downloadrneovim-550651c130c014e6c668644273db31dd96be475e.tar.gz
rneovim-550651c130c014e6c668644273db31dd96be475e.tar.bz2
rneovim-550651c130c014e6c668644273db31dd96be475e.zip
ext_cmdline: use standard external ui functions
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 72b97cbab9..3c9614dfcd 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -11147,15 +11147,12 @@ void get_user_input(const typval_T *const argvars,
cmd_silent = false; // Want to see the prompt.
// Only the part of the message after the last NL is considered as
- // prompt for the command line.
- const char *p = strrchr(prompt, '\n');
- if (ui_is_external(kUICmdline)) {
- p = prompt;
- } else {
- if (p == NULL) {
- p = prompt;
- } else {
- p++;
+ // prompt for the command line, unlsess cmdline is externalized
+ const char *p = prompt;
+ if (!ui_is_external(kUICmdline)) {
+ const char *lastnl = strrchr(prompt, '\n');
+ if (lastnl != NULL) {
+ p = lastnl+1;
msg_start();
msg_clr_eos();
msg_puts_attr_len(prompt, p - prompt, echo_attr);