aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-03-16 19:46:15 -0400
committerJustin M. Keyes <justinkz@gmail.com>2019-03-17 00:46:15 +0100
commit32998731bf19df219b8d3140943cfffe643573a5 (patch)
treebcc97e5adb6c7c4db7f87b99cb2ce594ebf2d5f2
parentd8316f2a1b0d7886aabcd0f96e917129b4ae74c8 (diff)
downloadrneovim-32998731bf19df219b8d3140943cfffe643573a5.tar.gz
rneovim-32998731bf19df219b8d3140943cfffe643573a5.tar.bz2
rneovim-32998731bf19df219b8d3140943cfffe643573a5.zip
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) https://github.com/vim/vim/commit/2ba4238818ca5ea52334de3037ef3729584cebf5
-rw-r--r--src/nvim/misc1.c3
-rw-r--r--src/nvim/testdir/test_edit.vim13
2 files changed, 12 insertions, 4 deletions
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c
index 64a4b8b0b4..d06fa8f762 100644
--- a/src/nvim/misc1.c
+++ b/src/nvim/misc1.c
@@ -710,9 +710,6 @@ open_line (
less_cols_off++;
}
}
- if (*p_extra != NUL) {
- did_ai = false; // append some text, don't truncate now
- }
/* columns for marks adjusted for removed columns */
less_cols = (int)(p_extra - saved_line);
diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim
index f8946c6929..fa7cfaa40c 100644
--- a/src/nvim/testdir/test_edit.vim
+++ b/src/nvim/testdir/test_edit.vim
@@ -402,8 +402,19 @@ func! Test_edit_13()
call feedkeys("A {\<cr>more\<cr>}\<esc>", 'tnix')
call assert_equal(["\tabc {", "\t\tmore", "\t}"], getline(1, '$'))
set smartindent& autoindent&
- bw!
+ bwipe!
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
func! Test_edit_CR()