diff src/testdir/test_blockedit.vim @ 26307:294736db2561 v8.2.3684

patch 8.2.3684: blockwise insert does not handle autoindent properly Commit: https://github.com/vim/vim/commit/e9b0b40b7978f683977922233b42dd439ef31920 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 27 13:28:24 2021 +0000 patch 8.2.3684: blockwise insert does not handle autoindent properly Problem: Blockwise insert does not handle autoindent properly. Solution: Adjust text column for indent. (closes https://github.com/vim/vim/issues/9229)
author Bram Moolenaar <Bram@vim.org>
date Sat, 27 Nov 2021 14:30:03 +0100
parents bd46322bea66
children 74e706afae3f
line wrap: on
line diff
--- a/src/testdir/test_blockedit.vim
+++ b/src/testdir/test_blockedit.vim
@@ -14,6 +14,33 @@ func Test_blockinsert_indent()
   bwipe!
 endfunc
 
+func Test_blockinsert_autoindent()
+  new
+  let lines =<< trim END
+      var d = {
+      a: () => 0,
+      b: () => 0,
+      c: () => 0,
+      }
+  END
+  call setline(1, lines)
+  filetype plugin indent on
+  setlocal sw=2 et ft=vim
+  setlocal indentkeys+=:
+  exe "norm! 2Gf)\<c-v>2jA: asdf\<esc>"
+  let expected =<< trim END
+      var d = {
+        a: (): asdf => 0,
+      b: (): asdf => 0,
+      c: (): asdf => 0,
+      }
+  END
+  call assert_equal(expected, getline(1, 5))
+
+  filetype off
+  bwipe!
+endfunc
+
 func Test_blockinsert_delete()
   new
   let _bs = &bs