Skip to content

Commit 6f62fed

Browse files
committed
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.
1 parent a988496 commit 6f62fed

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

src/ex_getln.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3068,12 +3068,12 @@ restore_cmdline_alloc(p)
30683068
#endif
30693069

30703070
/*
3071-
* paste a yank register into the command line.
3072-
* used by CTRL-R command in command-line mode
3071+
* Paste a yank register into the command line.
3072+
* Used by CTRL-R command in command-line mode.
30733073
* insert_reg() can't be used here, because special characters from the
30743074
* register contents will be interpreted as commands.
30753075
*
3076-
* return FAIL for failure, OK otherwise
3076+
* Return FAIL for failure, OK otherwise.
30773077
*/
30783078
static int
30793079
cmdline_paste(regname, literally, remcr)

src/ops.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ get_spec_reg(regname, argp, allocated, errmsg)
15771577
cmdline_paste_reg(regname, literally, remcr)
15781578
int regname;
15791579
int literally; /* Insert text literally instead of "as typed" */
1580-
int remcr; /* don't add trailing CR */
1580+
int remcr; /* don't add CR characters */
15811581
{
15821582
long i;
15831583

@@ -1590,12 +1590,8 @@ cmdline_paste_reg(regname, literally, remcr)
15901590
cmdline_paste_str(y_current->y_array[i], literally);
15911591

15921592
/* Insert ^M between lines and after last line if type is MLINE.
1593-
* Don't do this when "remcr" is TRUE and the next line is empty. */
1594-
if (y_current->y_type == MLINE
1595-
|| (i < y_current->y_size - 1
1596-
&& !(remcr
1597-
&& i == y_current->y_size - 2
1598-
&& *y_current->y_array[i + 1] == NUL)))
1593+
* Don't do this when "remcr" is TRUE. */
1594+
if ((y_current->y_type == MLINE || i < y_current->y_size - 1) && !remcr)
15991595
cmdline_paste_str((char_u *)"\r", literally);
16001596

16011597
/* Check for CTRL-C, in case someone tries to paste a few thousand

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
973,
744746
/**/
745747
972,
746748
/**/

0 commit comments

Comments
 (0)