diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-12-27 18:04:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-27 18:04:42 +0800 |
commit | 146c428a533b649adbc95fc29b41af42624b6ece (patch) | |
tree | 9507dfcf9f60b69277d8ce9ed9515c8a9f6d8552 /test/functional/api/vim_spec.lua | |
parent | cd6ec1db068f9f4c1900a00b5392e39e59f0a7cb (diff) | |
download | rneovim-146c428a533b649adbc95fc29b41af42624b6ece.tar.gz rneovim-146c428a533b649adbc95fc29b41af42624b6ece.tar.bz2 rneovim-146c428a533b649adbc95fc29b41af42624b6ece.zip |
fix(statusline): make nvim_eval_statusline() work with %S (#21553)
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 531b9cc2c1..98bfb83dbd 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -3126,6 +3126,19 @@ describe('API', function() eq('E539: Illegal character <}>', pcall_err(meths.eval_statusline, '%{%}', {})) end) + it('supports %S item', function() + local screen = Screen.new(80, 24) + screen:attach() + command('set showcmd') + feed('1234') + screen:expect({any = '1234'}) + eq({ str = '1234', width = 4 }, + meths.eval_statusline('%S', { maxwidth = 5 })) + feed('56') + screen:expect({any = '123456'}) + eq({ str = '<3456', width = 5 }, + meths.eval_statusline('%S', { maxwidth = 5 })) + end) describe('highlight parsing', function() it('works', function() eq({ |