From bfa92d3861e425b59f9b1793c08247965a8e53f5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 25 Apr 2023 22:22:26 +0800 Subject: vim-patch:8.2.5019: cannot get the first screen column of a character (#23312) Problem: Cannot get the first screen column of a character. Solution: Let virtcol() optionally return a list. (closes vim/vim#10482, closes vim/vim#7964) https://github.com/vim/vim/commit/0f7a3e1de6f71e8e1423fe594890d6aa7f94e132 Co-authored-by: LemonBoy --- test/old/testdir/test_functions.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim index 78eab3aaa5..a1f34ea8b6 100644 --- a/test/old/testdir/test_functions.vim +++ b/test/old/testdir/test_functions.vim @@ -2607,4 +2607,15 @@ func Test_builtin_check() endfunc +" Test for virtcol() +func Test_virtcol() + enew! + call setline(1, "the\tquick\tbrown\tfox") + norm! 4| + call assert_equal(8, virtcol('.')) + call assert_equal(8, virtcol('.', v:false)) + call assert_equal([4, 8], virtcol('.', v:true)) + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit