]> granicus.if.org Git - vim/commitdiff
patch 7.4.973 v7.4.973
authorBram Moolenaar <Bram@vim.org>
Thu, 17 Dec 2015 13:04:24 +0000 (14:04 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 17 Dec 2015 13:04:24 +0000 (14:04 +0100)
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.

src/ex_getln.c
src/ops.c
src/version.c

index 0aeb4b8c8d48467db519518d13bd47db3077c294..b6aeacf1a9d85381daf30e44b40b7cc5e32e1490 100644 (file)
@@ -3068,12 +3068,12 @@ restore_cmdline_alloc(p)
 #endif
 
 /*
- * paste a yank register into the command line.
- * used by CTRL-R command in command-line mode
+ * Paste a yank register into the command line.
+ * Used by CTRL-R command in command-line mode.
  * insert_reg() can't be used here, because special characters from the
  * register contents will be interpreted as commands.
  *
- * return FAIL for failure, OK otherwise
+ * Return FAIL for failure, OK otherwise.
  */
     static int
 cmdline_paste(regname, literally, remcr)
index d0995801285f3f9250e10104aa2a37fa286e3e64..c86d8de9413ed5a878db9ea94157db5f9322d975 100644 (file)
--- 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
index 8a4eddaab1574fcd15ca969b55b91ba49650a678..5c23005cc710aff719dc1443b5e68543aa1942fa 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    973,
 /**/
     972,
 /**/