1
0
forked from aniani/vim

patch 8.2.5019: cannot get the first screen column of a character

Problem:    Cannot get the first screen column of a character.
Solution:   Let virtcol() optionally return a list. (closes #10482,
            closes #7964)
This commit is contained in:
LemonBoy
2022-05-26 12:10:37 +01:00
committed by Bram Moolenaar
parent c3caa7f788
commit 0f7a3e1de6
5 changed files with 96 additions and 26 deletions

View File

@@ -2947,4 +2947,15 @@ func Test_exepath()
endif
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