]> granicus.if.org Git - vim/commitdiff
patch 8.0.0230: bracketed paste does not support line breaks v8.0.0230
authorBram Moolenaar <Bram@vim.org>
Tue, 24 Jan 2017 16:50:52 +0000 (17:50 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 24 Jan 2017 16:50:52 +0000 (17:50 +0100)
Problem:    When using bracketed paste line breaks are not respected.
Solution:   Turn CR characters into a line break if the text is being
            inserted. (closes #1404)

src/edit.c
src/version.c

index 61d92170f4be3c366d43118e33fc384e8db7d563..ce6abaf209336ccb9ed8e22be0d8ad6da18746bd 100644 (file)
@@ -9498,7 +9498,11 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
                case PASTE_INSERT:
                    if (stop_arrow() == OK)
                    {
-                       ins_char_bytes(buf, idx);
+                       c = buf[0];
+                       if (idx == 1 && (c == CAR || c == K_KENTER || c == NL))
+                           ins_eol(c);
+                       else
+                           ins_char_bytes(buf, idx);
                        AppendToRedobuffLit(buf, idx);
                    }
                    break;
index 829b3b94c89e5584e0d80e5e02da06003cb0455d..c7528b7d971889f8e1e30bccfe45f6d23fc85b99 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    230,
 /**/
     229,
 /**/