File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -10294,6 +10294,9 @@ ex_startinsert(exarg_T *eap)
1029410294{
1029510295 if (eap -> forceit )
1029610296 {
10297+ /* cursor line can be zero on startup */
10298+ if (!curwin -> w_cursor .lnum )
10299+ curwin -> w_cursor .lnum = 1 ;
1029710300 coladvance ((colnr_T )MAXCOL );
1029810301 curwin -> w_curswant = MAXCOL ;
1029910302 curwin -> w_set_curswant = FALSE;
Original file line number Diff line number Diff line change @@ -263,3 +263,27 @@ func Test_default_term()
263263 call assert_match (" defaulting to 'ansi'" , out)
264264 let $TERM = save_term
265265endfunc
266+
267+ func Test_zzz_startinsert ()
268+ " Test :startinsert
269+ call writefile ([' 123456' ], ' Xtestout' )
270+ let after = [
271+ \ ' :startinsert' ,
272+ \ ' call feedkeys("foobar\<c-o>:wq\<cr>","t")'
273+ \ ]
274+ if RunVim ([], after, ' Xtestout' )
275+ let lines = readfile (' Xtestout' )
276+ call assert_equal ([' foobar123456' ], lines )
277+ endif
278+ " Test :startinsert!
279+ call writefile ([' 123456' ], ' Xtestout' )
280+ let after = [
281+ \ ' :startinsert!' ,
282+ \ ' call feedkeys("foobar\<c-o>:wq\<cr>","t")'
283+ \ ]
284+ if RunVim ([], after, ' Xtestout' )
285+ let lines = readfile (' Xtestout' )
286+ call assert_equal ([' 123456foobar' ], lines )
287+ endif
288+ call delete (' Xtestout' )
289+ endfunc
Original file line number Diff line number Diff line change @@ -761,6 +761,8 @@ static char *(features[]) =
761761
762762static int included_patches [] =
763763{ /* Add new patch number below this line */
764+ /**/
765+ 1151 ,
764766/**/
765767 1150 ,
766768/**/
You can’t perform that action at this time.
0 commit comments