Problem: Invalid memory access when using an expression on the command line.
Solution: Make sure the position does not go negative.
{
int i;
int c;
+ int save_new_cmdpos = new_cmdpos;
#ifdef USE_ON_FLY_SCROLL
dont_scroll = TRUE; // disallow scrolling here
#ifdef FEAT_EVAL
/*
* 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 (c == '=')
}
#endif
}
+ new_cmdpos = save_new_cmdpos;
+
// remove the double quote
redrawcmd();
call assert_equal("\"e \<C-\>\<C-Y>", @:)
endfunc
+" This was making the insert position negative
+func Test_cmdline_expr_register()
+ exe "sil! norm! ?\<C-\>e0\<C-R>0\<Esc>?\<C-\>e0\<CR>"
+endfunc
+
" Test for 'imcmdline' and 'imsearch'
" This test doesn't actually test the input method functionality.
func Test_cmdline_inputmethod()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 5148,
/**/
5147,
/**/