diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-01-24 17:50:52 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-01-24 17:50:52 +0100 |
commit | 915350edec02f0326ecbe49f3b6cf2cbcd105f7d (patch) | |
tree | 76497fbf2f6f16f623407c96b61a03969be3b8af /src/edit.c | |
parent | 24a2d416ec261829ff7fd29f7b66739c96dd6513 (diff) |
patch 8.0.0230: bracketed paste does not support line breaksv8.0.0230
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)
Diffstat (limited to 'src/edit.c')
-rw-r--r-- | src/edit.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/edit.c b/src/edit.c index 61d92170f4..ce6abaf209 100644 --- a/src/edit.c +++ b/src/edit.c @@ -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; |