mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.1011: indent from autoindent not removed #9742
Problem: Indent from autoindent not removed from blank line. (Daniel Hahler)
Solution: Do not reset did_ai when text follows. (closes vim/vim#4119)
2ba4238818
This commit is contained in:
parent
d8316f2a1b
commit
32998731bf
@ -710,9 +710,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);
|
||||||
|
@ -402,8 +402,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()
|
||||||
|
Loading…
Reference in New Issue
Block a user