File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -5099,19 +5099,23 @@ nv_replace(cmdarg_T *cap)
50995099 {
51005100 /*
51015101 * Get ptr again, because u_save and/or showmatch() will have
5102- * released the line. At the same time we let know that the
5103- * line will be changed.
5102+ * released the line. This may also happen in ins_copychar().
5103+ * At the same time we let know that the line will be changed.
51045104 */
5105- ptr = ml_get_buf (curbuf , curwin -> w_cursor .lnum , TRUE);
51065105 if (cap -> nchar == Ctrl_E || cap -> nchar == Ctrl_Y )
51075106 {
51085107 int c = ins_copychar (curwin -> w_cursor .lnum
51095108 + (cap -> nchar == Ctrl_Y ? -1 : 1 ));
5109+
5110+ ptr = ml_get_buf (curbuf , curwin -> w_cursor .lnum , TRUE);
51105111 if (c != NUL )
51115112 ptr [curwin -> w_cursor .col ] = c ;
51125113 }
51135114 else
5115+ {
5116+ ptr = ml_get_buf (curbuf , curwin -> w_cursor .lnum , TRUE);
51145117 ptr [curwin -> w_cursor .col ] = cap -> nchar ;
5118+ }
51155119 if (p_sm && msg_silent == 0 )
51165120 showmatch (cap -> nchar );
51175121 ++ curwin -> w_cursor .col ;
Original file line number Diff line number Diff line change @@ -1895,4 +1895,16 @@ func Test_edit_revins()
18951895 bw !
18961896endfunc
18971897
1898+ " Test for getting the character of the line below after "p"
1899+ func Test_edit_put_CTRL_E ()
1900+ set encoding = latin1
1901+ new
1902+ let @" = ' '
1903+ sil ! norm or ggRx
1904+ sil ! norm pr
1905+ call assert_equal ([' r' , ' r' ], getline (1 , 2 ))
1906+ bwipe!
1907+ set encoding = utf- 8
1908+ endfunc
1909+
18981910" vim: shiftwidth = 2 sts = 2 expandtab
Original file line number Diff line number Diff line change @@ -755,6 +755,8 @@ static char *(features[]) =
755755
756756static int included_patches [] =
757757{ /* Add new patch number below this line */
758+ /**/
759+ 3428 ,
758760/**/
759761 3427 ,
760762/**/
You can’t perform that action at this time.
0 commit comments