comparison src/testdir/test_quickfix.vim @ 15703:b8a2362073bb v8.1.0859

patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters commit https://github.com/vim/vim/commit/c45eb770a5988734ff2c572e5e2ce307158c33c8 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 31 14:27:04 2019 +0100 patch 8.1.0859: "%v" in 'errorformat' does handle multi-byte characters Problem: "%v" in 'errorformat' does handle multi-byte characters. Solution: Handle multi-byte characters. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/3700)
author Bram Moolenaar <Bram@vim.org>
date Thu, 31 Jan 2019 14:30:07 +0100
parents 90c8ff9c19ee
children 2fe4a503c5ad
comparison
equal deleted inserted replaced
15702:1d5946ec85cd 15703:b8a2362073bb
3841 new | only 3841 new | only
3842 3842
3843 call delete('Xtestfile1') 3843 call delete('Xtestfile1')
3844 call delete('Xtestfile2') 3844 call delete('Xtestfile2')
3845 endfunc 3845 endfunc
3846
3847 " Test for parsing entries using visual screen column
3848 func Test_viscol()
3849 enew
3850 call writefile(["Col1\tCol2\tCol3"], 'Xfile1')
3851 edit Xfile1
3852
3853 " Use byte offset for column number
3854 set efm&
3855 cexpr "Xfile1:1:5:XX\nXfile1:1:9:YY\nXfile1:1:20:ZZ"
3856 call assert_equal([5, 8], [col('.'), virtcol('.')])
3857 cnext
3858 call assert_equal([9, 12], [col('.'), virtcol('.')])
3859 cnext
3860 call assert_equal([14, 20], [col('.'), virtcol('.')])
3861
3862 " Use screen column offset for column number
3863 set efm=%f:%l:%v:%m
3864 cexpr "Xfile1:1:8:XX\nXfile1:1:12:YY\nXfile1:1:20:ZZ"
3865 call assert_equal([5, 8], [col('.'), virtcol('.')])
3866 cnext
3867 call assert_equal([9, 12], [col('.'), virtcol('.')])
3868 cnext
3869 call assert_equal([14, 20], [col('.'), virtcol('.')])
3870 cexpr "Xfile1:1:6:XX\nXfile1:1:15:YY\nXfile1:1:24:ZZ"
3871 call assert_equal([5, 8], [col('.'), virtcol('.')])
3872 cnext
3873 call assert_equal([10, 16], [col('.'), virtcol('.')])
3874 cnext
3875 call assert_equal([14, 20], [col('.'), virtcol('.')])
3876
3877 enew
3878 call writefile(["Col1\täü\töß\tCol4"], 'Xfile1')
3879
3880 " Use byte offset for column number
3881 set efm&
3882 cexpr "Xfile1:1:8:XX\nXfile1:1:11:YY\nXfile1:1:16:ZZ"
3883 call assert_equal([8, 10], [col('.'), virtcol('.')])
3884 cnext
3885 call assert_equal([11, 17], [col('.'), virtcol('.')])
3886 cnext
3887 call assert_equal([16, 25], [col('.'), virtcol('.')])
3888
3889 " Use screen column offset for column number
3890 set efm=%f:%l:%v:%m
3891 cexpr "Xfile1:1:10:XX\nXfile1:1:17:YY\nXfile1:1:25:ZZ"
3892 call assert_equal([8, 10], [col('.'), virtcol('.')])
3893 cnext
3894 call assert_equal([11, 17], [col('.'), virtcol('.')])
3895 cnext
3896 call assert_equal([16, 25], [col('.'), virtcol('.')])
3897
3898 enew | only
3899 set efm&
3900 call delete('Xfile1')
3901 endfunc