aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/vim_spec.lua
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-04-01 14:58:52 +0200
committerLuuk van Baal <luukvbaal@gmail.com>2023-04-05 12:36:47 +0200
commitf0ac91c58b42ed4f38dea7352d89fd39a88142f4 (patch)
tree743426a5cb8b6c37ae4cb48e7cd8c06a2dcde8d2 /test/functional/api/vim_spec.lua
parent9e7426718b678e299f3fd03ef94f81b1e2d01ab0 (diff)
downloadrneovim-f0ac91c58b42ed4f38dea7352d89fd39a88142f4.tar.gz
rneovim-f0ac91c58b42ed4f38dea7352d89fd39a88142f4.tar.bz2
rneovim-f0ac91c58b42ed4f38dea7352d89fd39a88142f4.zip
feat(api): evaluate 'statuscolumn' with nvim_eval_statusline()
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r--test/functional/api/vim_spec.lua34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index ab26425425..cddea48a76 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -3421,6 +3421,40 @@ describe('API', function()
'TextWithNoHighlight%#WarningMsg#TextWithWarningHighlight',
{ use_winbar = true, highlights = true }))
end)
+ it('works with statuscolumn', function()
+ command([[
+ let &stc='%C%s%=%l '
+ set cul nu nuw=3 scl=yes:2 fdc=2
+ call setline(1, repeat(['aaaaa'], 5))
+ let g:ns = nvim_create_namespace('')
+ call sign_define('a', {'text':'aa', 'texthl':'IncSearch', 'numhl':'Normal'})
+ call sign_place(2, 1, 'a', bufnr(), {'lnum':4})
+ call nvim_buf_set_extmark(0, g:ns, 3, 1, { 'sign_text':'bb', 'sign_hl_group':'ErrorMsg' })
+ 1,5fold | 1,5 fold | foldopen!
+ ]])
+ command('norm 4G')
+ command('let v:lnum=4')
+ eq({
+ str = '││aabb 4 ',
+ width = 9,
+ highlights = {
+ { group = 'CursorLineFold', start = 0 },
+ { group = 'Normal', start = 6 },
+ { group = 'IncSearch', start = 6 },
+ { group = 'ErrorMsg', start = 8 },
+ { group = 'Normal', start = 10 }
+ }
+ }, meths.eval_statusline('%C%s%=%l ', { use_statuscol = true, highlights = true }))
+ command('let v:lnum=3')
+ eq({
+ str = '3 ' ,
+ width = 2,
+ highlights = {
+ { group = 'LineNr', start = 0 },
+ { group = 'ErrorMsg', start = 1 }
+ }
+ }, meths.eval_statusline('%l%#ErrorMsg# ', { use_statuscol = true, highlights = true }))
+ end)
it('no memory leak with click functions', function()
meths.eval_statusline('%@ClickFunc@StatusLineStringWithClickFunc%T', {})
eq({