summaryrefslogtreecommitdiff
path: root/src/ops.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-12-17 14:04:24 +0100
committerBram Moolenaar <Bram@vim.org>2015-12-17 14:04:24 +0100
commit6f62fed349bf829da2adb02619dc9acba13c8ab6 (patch)
treec2d4006200a8b4477db1f5b8a352a6ac30165627 /src/ops.c
parenta98849670674264de699d7ab22ae4b9b32e78f4a (diff)
downloadvim-git-6f62fed349bf829da2adb02619dc9acba13c8ab6.tar.gz
patch 7.4.973v7.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.
Diffstat (limited to 'src/ops.c')
-rw-r--r--src/ops.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/ops.c b/src/ops.c
index d09958012..c86d8de94 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -1577,7 +1577,7 @@ get_spec_reg(regname, argp, allocated, errmsg)
cmdline_paste_reg(regname, literally, remcr)
int regname;
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;
@@ -1590,12 +1590,8 @@ cmdline_paste_reg(regname, literally, remcr)
cmdline_paste_str(y_current->y_array[i], literally);
/* 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. */
- if (y_current->y_type == MLINE
- || (i < y_current->y_size - 1
- && !(remcr
- && i == y_current->y_size - 2
- && *y_current->y_array[i + 1] == NUL)))
+ * Don't do this when "remcr" is TRUE. */
+ if ((y_current->y_type == MLINE || i < y_current->y_size - 1) && !remcr)
cmdline_paste_str((char_u *)"\r", literally);
/* Check for CTRL-C, in case someone tries to paste a few thousand