diff src/testdir/test_blockedit.vim @ 26313:74e706afae3f v8.2.3687

patch 8.2.3687: blockwise insert does not handle autoindent properly Commit: https://github.com/vim/vim/commit/59f4f9505ae7ca2499904b94100db103e5ada5a6 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 27 22:47:43 2021 +0000 patch 8.2.3687: blockwise insert does not handle autoindent properly Problem: Blockwise insert does not handle autoindent properly when tab is inserted. Solution: Adjust text column for indent before computing column. (closes #9229)
author Bram Moolenaar <Bram@vim.org>
date Sun, 28 Nov 2021 00:00:04 +0100
parents 294736db2561
children 84ea6d876d43
line wrap: on
line diff
--- a/src/testdir/test_blockedit.vim
+++ b/src/testdir/test_blockedit.vim
@@ -37,6 +37,31 @@ func Test_blockinsert_autoindent()
   END
   call assert_equal(expected, getline(1, 5))
 
+  " insert on the next column should do exactly the same
+  :%dele
+  call setline(1, lines)
+  exe "norm! 2Gf)l\<c-v>2jI: asdf\<esc>"
+  call assert_equal(expected, getline(1, 5))
+
+  :%dele
+  call setline(1, lines)
+  setlocal sw=8 noet
+  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))
+
+  " insert on the next column should do exactly the same
+  :%dele
+  call setline(1, lines)
+  exe "norm! 2Gf)l\<c-v>2jI: asdf\<esc>"
+  call assert_equal(expected, getline(1, 5))
+
   filetype off
   bwipe!
 endfunc