fix: display virtual column number in location component (#835)
This commit is contained in:
parent
5d133a1ef2
commit
2061fcbf3b
|
@ -2,7 +2,7 @@
|
|||
-- MIT license, see LICENSE for more details.
|
||||
local function location()
|
||||
local line = vim.fn.line('.')
|
||||
local col = vim.fn.col('.')
|
||||
local col = vim.fn.virtcol('.')
|
||||
return string.format('%3d:%-2d', line, col)
|
||||
end
|
||||
|
||||
|
|
|
@ -405,6 +405,12 @@ describe('Location component', function()
|
|||
assert_component('location', opts, ' 10:1 ')
|
||||
vim.api.nvim_win_set_cursor(0, {5, 0})
|
||||
assert_component('location', opts, ' 5:1 ')
|
||||
-- test column number
|
||||
vim.cmd('normal! oTest')
|
||||
assert_component('location', opts, ' 6:4 ')
|
||||
-- test column number in line containing cyrillic symbols
|
||||
vim.cmd('normal! oТест')
|
||||
assert_component('location', opts, ' 7:4 ')
|
||||
vim.cmd('bdelete!')
|
||||
end)
|
||||
end)
|
||||
|
|
Loading…
Reference in New Issue