]> granicus.if.org Git - vim/commitdiff
patch 8.1.1011: indent from autoindent not removed from blank line v8.1.1011
authorBram Moolenaar <Bram@vim.org>
Sat, 16 Mar 2019 17:11:07 +0000 (18:11 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 16 Mar 2019 17:11:07 +0000 (18:11 +0100)
Problem:    Indent from autoindent not removed from blank line. (Daniel Hahler)
Solution:   Do not reset did_ai when text follows. (closes #4119)

src/misc1.c
src/testdir/test_edit.vim
src/version.c

index 65d5e9ec54dfdcd5b5065471c2f81efd2f30d52e..5781aa5b39eb4b12f9e68d37d35dee598727d925 100644 (file)
@@ -1497,8 +1497,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);
index 9a60d018e11ec83c1a7f21c68dbcb92120c8a6ee..b35497fc2aa586997d5b58769a4f4d5c017502e9 100644 (file)
@@ -399,8 +399,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()
index dc2d73d44e7f4154f0157f23705ec6abf81b2bf4..35b40ca3b3290c72a8930c877f3df9479a26a8a7 100644 (file)
@@ -779,6 +779,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1011,
 /**/
     1010,
 /**/