comparison 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
comparison
equal deleted inserted replaced
26306:f2bc5e27cd82 26307:294736db2561
8 call cursor(2, 3) 8 call cursor(2, 3)
9 exe "norm! \<c-v>2jI\\ \<esc>" 9 exe "norm! \<c-v>2jI\\ \<esc>"
10 call assert_equal(['let a=[', ' \ ''eins'',', ' \ ''zwei'',', ' \ ''drei'']'], 10 call assert_equal(['let a=[', ' \ ''eins'',', ' \ ''zwei'',', ' \ ''drei'']'],
11 \ getline(1,'$')) 11 \ getline(1,'$'))
12 " reset to sane state 12 " reset to sane state
13 filetype off
14 bwipe!
15 endfunc
16
17 func Test_blockinsert_autoindent()
18 new
19 let lines =<< trim END
20 var d = {
21 a: () => 0,
22 b: () => 0,
23 c: () => 0,
24 }
25 END
26 call setline(1, lines)
27 filetype plugin indent on
28 setlocal sw=2 et ft=vim
29 setlocal indentkeys+=:
30 exe "norm! 2Gf)\<c-v>2jA: asdf\<esc>"
31 let expected =<< trim END
32 var d = {
33 a: (): asdf => 0,
34 b: (): asdf => 0,
35 c: (): asdf => 0,
36 }
37 END
38 call assert_equal(expected, getline(1, 5))
39
13 filetype off 40 filetype off
14 bwipe! 41 bwipe!
15 endfunc 42 endfunc
16 43
17 func Test_blockinsert_delete() 44 func Test_blockinsert_delete()