From a245dd79a267c8b56866023e84b49d0ecffca65b Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 16 Aug 2023 06:28:52 +0800 Subject: vim-patch:9.0.1717: virtcol2col returns last byte of a multi-byte char (#24729) Problem: virtcol2col returns last byte of a multi-byte char Solution: Make it return the first byte for a multi-byte char closes: vim/vim#12786 closes: vim/vim#12799 https://github.com/vim/vim/commit/b209b86e6636a16088ccacdac98213416c065bf2 Co-authored-by: Yegappan Lakshmanan --- runtime/lua/vim/_meta/vimfn.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/lua/vim/_meta/vimfn.lua') diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index acf1b3a0f5..d1173e8a42 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -10016,6 +10016,9 @@ function vim.fn.virtcol(expr, list) end --- {lnum}, then the byte index of the character at the last --- virtual column is returned. --- +--- For a multi-byte character, the column number of the first +--- byte in the character is returned. +--- --- The {winid} argument can be the window number or the --- |window-ID|. If this is zero, then the current window is used. --- -- cgit