forked from aniani/vim
patch 8.1.1011: indent from autoindent not removed from blank line
Problem: Indent from autoindent not removed from blank line. (Daniel Hahler) Solution: Do not reset did_ai when text follows. (closes #4119)
This commit is contained in:
@@ -1497,8 +1497,6 @@ open_line(
|
|||||||
++less_cols_off;
|
++less_cols_off;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (*p_extra != NUL)
|
|
||||||
did_ai = FALSE; /* append some text, don't truncate now */
|
|
||||||
|
|
||||||
/* columns for marks adjusted for removed columns */
|
/* columns for marks adjusted for removed columns */
|
||||||
less_cols = (int)(p_extra - saved_line);
|
less_cols = (int)(p_extra - saved_line);
|
||||||
|
@@ -399,8 +399,19 @@ func Test_edit_13()
|
|||||||
call feedkeys("A {\<cr>more\<cr>}\<esc>", 'tnix')
|
call feedkeys("A {\<cr>more\<cr>}\<esc>", 'tnix')
|
||||||
call assert_equal(["\tabc {", "\t\tmore", "\t}"], getline(1, '$'))
|
call assert_equal(["\tabc {", "\t\tmore", "\t}"], getline(1, '$'))
|
||||||
set smartindent& autoindent&
|
set smartindent& autoindent&
|
||||||
bw!
|
bwipe!
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Test autoindent removing indent of blank line.
|
||||||
|
new
|
||||||
|
call setline(1, ' foo bar baz')
|
||||||
|
set autoindent
|
||||||
|
exe "normal 0eea\<CR>\<CR>\<Esc>"
|
||||||
|
call assert_equal(" foo bar", getline(1))
|
||||||
|
call assert_equal("", getline(2))
|
||||||
|
call assert_equal(" baz", getline(3))
|
||||||
|
set autoindent&
|
||||||
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_edit_CR()
|
func Test_edit_CR()
|
||||||
|
@@ -779,6 +779,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1011,
|
||||||
/**/
|
/**/
|
||||||
1010,
|
1010,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user