mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 7.4.973
Problem: When pasting on the command line line breaks result in literal <CR> characters. This makes pasting a long file name difficult. Solution: Skip the characters.
This commit is contained in:
parent
a988496706
commit
6f62fed349
@ -3068,12 +3068,12 @@ restore_cmdline_alloc(p)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* paste a yank register into the command line.
|
* Paste a yank register into the command line.
|
||||||
* used by CTRL-R command in command-line mode
|
* Used by CTRL-R command in command-line mode.
|
||||||
* insert_reg() can't be used here, because special characters from the
|
* insert_reg() can't be used here, because special characters from the
|
||||||
* register contents will be interpreted as commands.
|
* register contents will be interpreted as commands.
|
||||||
*
|
*
|
||||||
* return FAIL for failure, OK otherwise
|
* Return FAIL for failure, OK otherwise.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
cmdline_paste(regname, literally, remcr)
|
cmdline_paste(regname, literally, remcr)
|
||||||
|
10
src/ops.c
10
src/ops.c
@ -1577,7 +1577,7 @@ get_spec_reg(regname, argp, allocated, errmsg)
|
|||||||
cmdline_paste_reg(regname, literally, remcr)
|
cmdline_paste_reg(regname, literally, remcr)
|
||||||
int regname;
|
int regname;
|
||||||
int literally; /* Insert text literally instead of "as typed" */
|
int literally; /* Insert text literally instead of "as typed" */
|
||||||
int remcr; /* don't add trailing CR */
|
int remcr; /* don't add CR characters */
|
||||||
{
|
{
|
||||||
long i;
|
long i;
|
||||||
|
|
||||||
@ -1590,12 +1590,8 @@ cmdline_paste_reg(regname, literally, remcr)
|
|||||||
cmdline_paste_str(y_current->y_array[i], literally);
|
cmdline_paste_str(y_current->y_array[i], literally);
|
||||||
|
|
||||||
/* Insert ^M between lines and after last line if type is MLINE.
|
/* Insert ^M between lines and after last line if type is MLINE.
|
||||||
* Don't do this when "remcr" is TRUE and the next line is empty. */
|
* Don't do this when "remcr" is TRUE. */
|
||||||
if (y_current->y_type == MLINE
|
if ((y_current->y_type == MLINE || i < y_current->y_size - 1) && !remcr)
|
||||||
|| (i < y_current->y_size - 1
|
|
||||||
&& !(remcr
|
|
||||||
&& i == y_current->y_size - 2
|
|
||||||
&& *y_current->y_array[i + 1] == NUL)))
|
|
||||||
cmdline_paste_str((char_u *)"\r", literally);
|
cmdline_paste_str((char_u *)"\r", literally);
|
||||||
|
|
||||||
/* Check for CTRL-C, in case someone tries to paste a few thousand
|
/* Check for CTRL-C, in case someone tries to paste a few thousand
|
||||||
|
@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
973,
|
||||||
/**/
|
/**/
|
||||||
972,
|
972,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user