aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 0520c0e4a0..89d295e1a8 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -1613,6 +1613,8 @@ static int command_line_handle_key(CommandLineState *s)
return 0; // back to cmd mode
case Ctrl_R: { // insert register
+ const int save_new_cmdpos = new_cmdpos;
+
putcmdline('"', true);
no_mapping++;
allow_keys++;
@@ -1627,8 +1629,6 @@ static int command_line_handle_key(CommandLineState *s)
no_mapping--;
allow_keys--;
// Insert the result of an expression.
- // Need to save the current command line, to be able to enter
- // a new one...
new_cmdpos = -1;
if (s->c == '=') {
if (ccline.cmdfirstc == '=' // can't do this recursively
@@ -1660,8 +1660,12 @@ static int command_line_handle_key(CommandLineState *s)
}
}
}
+ new_cmdpos = save_new_cmdpos;
+
+ // remove the double quote
ccline.special_char = NUL;
redrawcmd();
+
return command_line_changed(s);
}