diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-10-26 01:17:21 -0400 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2019-10-25 22:17:21 -0700 |
| commit | 0b771cd9aabfdee3ddc14c08af076f5df5cd0150 (patch) | |
| tree | 04a136eaf6f5fe81c04e2bc28dba30a9a11a81f5 /src/nvim/testdir | |
| parent | 99aa166cb105cb33df7bb153e93f15b509fcbc8c (diff) | |
| download | rneovim-0b771cd9aabfdee3ddc14c08af076f5df5cd0150.tar.gz rneovim-0b771cd9aabfdee3ddc14c08af076f5df5cd0150.tar.bz2 rneovim-0b771cd9aabfdee3ddc14c08af076f5df5cd0150.zip | |
vim-patch:8.1.0859: handle multibyte "%v" in 'errorformat' #11285
Problem: "%v" in 'errorformat' does handle multi-byte characters.
Solution: Handle multi-byte characters. (Yegappan Lakshmanan, closes vim/vim#3700)
https://github.com/vim/vim/commit/c45eb770a5988734ff2c572e5e2ce307158c33c8
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_quickfix.vim | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 4af986ffba..74f9e5b41d 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -3643,3 +3643,59 @@ func Test_curswant() call assert_equal(getcurpos()[4], virtcol('.')) cclose | helpclose endfunc + +" Test for parsing entries using visual screen column +func Test_viscol() + enew + call writefile(["Col1\tCol2\tCol3"], 'Xfile1') + edit Xfile1 + + " Use byte offset for column number + set efm& + cexpr "Xfile1:1:5:XX\nXfile1:1:9:YY\nXfile1:1:20:ZZ" + call assert_equal([5, 8], [col('.'), virtcol('.')]) + cnext + call assert_equal([9, 12], [col('.'), virtcol('.')]) + cnext + call assert_equal([14, 20], [col('.'), virtcol('.')]) + + " Use screen column offset for column number + set efm=%f:%l:%v:%m + cexpr "Xfile1:1:8:XX\nXfile1:1:12:YY\nXfile1:1:20:ZZ" + call assert_equal([5, 8], [col('.'), virtcol('.')]) + cnext + call assert_equal([9, 12], [col('.'), virtcol('.')]) + cnext + call assert_equal([14, 20], [col('.'), virtcol('.')]) + cexpr "Xfile1:1:6:XX\nXfile1:1:15:YY\nXfile1:1:24:ZZ" + call assert_equal([5, 8], [col('.'), virtcol('.')]) + cnext + call assert_equal([10, 16], [col('.'), virtcol('.')]) + cnext + call assert_equal([14, 20], [col('.'), virtcol('.')]) + + enew + call writefile(["Col1\täü\töß\tCol4"], 'Xfile1') + + " Use byte offset for column number + set efm& + cexpr "Xfile1:1:8:XX\nXfile1:1:11:YY\nXfile1:1:16:ZZ" + call assert_equal([8, 10], [col('.'), virtcol('.')]) + cnext + call assert_equal([11, 17], [col('.'), virtcol('.')]) + cnext + call assert_equal([16, 25], [col('.'), virtcol('.')]) + + " Use screen column offset for column number + set efm=%f:%l:%v:%m + cexpr "Xfile1:1:10:XX\nXfile1:1:17:YY\nXfile1:1:25:ZZ" + call assert_equal([8, 10], [col('.'), virtcol('.')]) + cnext + call assert_equal([11, 17], [col('.'), virtcol('.')]) + cnext + call assert_equal([16, 25], [col('.'), virtcol('.')]) + + enew | only + set efm& + call delete('Xfile1') +endfunc |