mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user