mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 05:28:33 +00:00
vim-patch:8.0.1787: cannot insert the whole cursor line
Problem: Cannot insert the whole cursor line.
Solution: Make CTRL-R CTRL-L work. (Andy Massimino, closes vim/vim#2857)
e2c8d83926
This commit is contained in:
@@ -3295,8 +3295,10 @@ static bool cmdline_paste(int regname, bool literally, bool remcr)
|
||||
/* check for valid regname; also accept special characters for CTRL-R in
|
||||
* the command line */
|
||||
if (regname != Ctrl_F && regname != Ctrl_P && regname != Ctrl_W
|
||||
&& regname != Ctrl_A && !valid_yank_reg(regname, false))
|
||||
&& regname != Ctrl_A && regname != Ctrl_L
|
||||
&& !valid_yank_reg(regname, false)) {
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
/* A register containing CTRL-R can cause an endless loop. Allow using
|
||||
* CTRL-C to break the loop. */
|
||||
|
@@ -1257,6 +1257,14 @@ int get_spec_reg(
|
||||
*allocated = TRUE;
|
||||
return TRUE;
|
||||
|
||||
case Ctrl_L: // Line under cursor
|
||||
if (!errmsg) {
|
||||
return false;
|
||||
}
|
||||
|
||||
*argp = ml_get_buf(curwin->w_buffer, curwin->w_cursor.lnum, false);
|
||||
return true;
|
||||
|
||||
case '_': /* black hole: always empty */
|
||||
*argp = (char_u *)"";
|
||||
return TRUE;
|
||||
|
@@ -321,6 +321,9 @@ func Test_paste_in_cmdline()
|
||||
call feedkeys("ft:aaa \<C-R>\<C-F> bbb\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"aaa /tmp/some bbb', @:)
|
||||
|
||||
call feedkeys(":aaa \<C-R>\<C-L> bbb\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"aaa '.getline(1).' bbb', @:)
|
||||
|
||||
set incsearch
|
||||
call feedkeys("fy:aaa veryl\<C-R>\<C-W> bbb\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"aaa verylongword bbb', @:)
|
||||
|
Reference in New Issue
Block a user