Mercurial > vim
diff src/testdir/test_functions.vim @ 28994:644b0f0541de v8.2.5019
patch 8.2.5019: cannot get the first screen column of a character
Commit: https://github.com/vim/vim/commit/0f7a3e1de6f71e8e1423fe594890d6aa7f94e132
Author: LemonBoy <thatlemon@gmail.com>
Date: Thu May 26 12:10:37 2022 +0100
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 https://github.com/vim/vim/issues/10482,
closes #7964)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 26 May 2022 13:15:04 +0200 |
parents | 995bc7ba8d5b |
children | c7bd1040a1c4 |
line wrap: on
line diff
--- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -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