diff options
| author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-23 04:43:44 -0400 |
|---|---|---|
| committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-23 10:00:53 -0400 |
| commit | d677ae5f6461dcd78f08caec2c4fa72e6e275137 (patch) | |
| tree | 939b783497deef4f314f008f7c593285672f02a9 /src/nvim/testdir | |
| parent | fe57a8a4e410e19f05a4137709632ee375b1c2aa (diff) | |
| download | rneovim-d677ae5f6461dcd78f08caec2c4fa72e6e275137.tar.gz rneovim-d677ae5f6461dcd78f08caec2c4fa72e6e275137.tar.bz2 rneovim-d677ae5f6461dcd78f08caec2c4fa72e6e275137.zip | |
vim-patch:8.0.1041: bogus characters when indenting during visual-block append
Problem: Bogus characters appear when indenting kicks in while doing a
visual-block append.
Solution: Recompute when indenting is done. (Christian Brabandt)
https://github.com/vim/vim/commit/e2e69e48134cbfdedea7802810932f8592705024
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_cindent.vim | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_cindent.vim b/src/nvim/testdir/test_cindent.vim index d352e8feff..7c2c5e341c 100644 --- a/src/nvim/testdir/test_cindent.vim +++ b/src/nvim/testdir/test_cindent.vim @@ -71,7 +71,7 @@ func Test_cino_extern_c() bwipe! endfunc -func! Test_cindent_rawstring() +func Test_cindent_rawstring() new setl cindent call feedkeys("i" . @@ -81,5 +81,25 @@ func! Test_cindent_rawstring() \ "statement;\<Esc>", "x") call assert_equal("\tstatement;", getline(line('.'))) bw! -endfunction +endfunc + +func Test_cindent_expr() + new + func! MyIndentFunction() + return v:lnum == 1 ? shiftwidth() : 0 + endfunc + setl expandtab sw=8 indentkeys+=; indentexpr=MyIndentFunction() + call setline(1, ['var_a = something()', 'b = something()']) + call cursor(1, 1) + call feedkeys("^\<c-v>j$A;\<esc>", 'tnix') + call assert_equal([' var_a = something();', 'b = something();'], getline(1, '$')) + + %d + call setline(1, [' var_a = something()', ' b = something()']) + call cursor(1, 1) + call feedkeys("^\<c-v>j$A;\<esc>", 'tnix') + call assert_equal([' var_a = something();', ' b = something()'], getline(1, '$')) + bw! +endfunc + " vim: shiftwidth=2 sts=2 expandtab |