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)

0f7a3e1de6

Co-authored-by: LemonBoy <thatlemon@gmail.com>
This commit is contained in:
zeertzjq
2023-04-25 22:22:26 +08:00
committed by GitHub
parent 43c49746d9
commit bfa92d3861
4 changed files with 53 additions and 17 deletions

View File

@@ -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