Skip to content

Commit a27eb06

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 4cefe0c + 9e817c8 commit a27eb06

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

src/edit.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9496,12 +9496,17 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
94969496
char_u *end = find_termcode((char_u *)"PE");
94979497
int ret_char = -1;
94989498
int save_allow_keys = allow_keys;
9499+
int save_paste = p_paste;
9500+
int save_ai = curbuf->b_p_ai;
94999501

95009502
/* If the end code is too long we can't detect it, read everything. */
95019503
if (STRLEN(end) >= NUMBUFLEN)
95029504
end = NULL;
95039505
++no_mapping;
95049506
allow_keys = 0;
9507+
p_paste = TRUE;
9508+
curbuf->b_p_ai = FALSE;
9509+
95059510
for (;;)
95069511
{
95079512
/* When the end is not defined read everything. */
@@ -9567,8 +9572,11 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
95679572
}
95689573
idx = 0;
95699574
}
9575+
95709576
--no_mapping;
95719577
allow_keys = save_allow_keys;
9578+
p_paste = save_paste;
9579+
curbuf->b_p_ai = save_ai;
95729580

95739581
return ret_char;
95749582
}

src/testdir/test_paste.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ func Test_paste_insert_mode()
3535
call assert_equal('bar donfoo', getline(3))
3636
call assert_equal('bar doneeb', getline(4))
3737
call assert_equal('c', getline(5))
38+
39+
set ai et tw=10
40+
call setline(1, ['a', ' b', 'c'])
41+
2
42+
call feedkeys("A\<Esc>[200~foo\<CR> bar bar bar\<Esc>[201~\<Esc>", 'xt')
43+
call assert_equal(' bfoo', getline(2))
44+
call assert_equal(' bar bar bar', getline(3))
45+
call assert_equal('c', getline(4))
46+
47+
set ai& et& tw=0
3848
bwipe!
3949
endfunc
4050

src/version.c

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

780780
static int included_patches[] =
781781
{ /* Add new patch number below this line */
782+
/**/
783+
238,
782784
/**/
783785
237,
784786
/**/

0 commit comments

Comments
 (0)