{
int i;
int c;
+ int literally = FALSE;
#ifdef FEAT_EVAL
int save_new_cmdpos = new_cmdpos;
#endif
#endif
if (c != ESC) // use ESC to cancel inserting register
{
- cmdline_paste(c, i == Ctrl_R, FALSE);
+ literally = i == Ctrl_R;
+ cmdline_paste(c, literally, FALSE);
#ifdef FEAT_EVAL
// When there was a serious error abort getting the
// remove the double quote
redrawcmd();
- // The text has been stuffed, the command line didn't change yet.
- return CMDLINE_NOT_CHANGED;
+ // The text has been stuffed, the command line didn't change yet, but it
+ // will change soon. The caller must take care of it.
+ return literally ? CMDLINE_NOT_CHANGED : CMDLINE_CHANGED;
}
/*
case Ctrl_R: // insert register
res = cmdline_insert_reg(&gotesc);
- if (res == CMDLINE_NOT_CHANGED)
- goto cmdline_not_changed;
- else if (res == GOTO_NORMAL_MODE)
+ if (res == GOTO_NORMAL_MODE)
goto returncmd;
- goto cmdline_changed;
+#ifdef FEAT_SEARCH_EXTRA
+ if (res == CMDLINE_NOT_CHANGED)
+ is_state.incsearch_postponed = TRUE;
+#endif
+ goto cmdline_not_changed;
case Ctrl_D:
if (showmatches(&xpc, FALSE) == EXPAND_NOTHING)
" Test for v:hlsearch
source check.vim
+source screendump.vim
func Test_hlsearch()
new
bwipe!
endfunc
+func Test_hlsearch_Ctrl_R()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ set incsearch hlsearch
+ let @" = "text"
+ put
+ END
+ call writefile(lines, 'XhlsearchCtrlR', 'D')
+ let buf = RunVimInTerminal('-S XhlsearchCtrlR', #{rows: 6, cols: 60})
+
+ call term_sendkeys(buf, "/\<C-R>\<C-R>\"")
+ call VerifyScreenDump(buf, 'Test_hlsearch_ctrlr_1', {})
+
+ call term_sendkeys(buf, "\<Esc>")
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab