diff options
| author | Shadman <shadmansaleh3@gmail.com> | 2021-05-15 23:10:41 +0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-15 13:10:41 -0400 |
| commit | d67dcaba02d76fe92ba818dde7b672fe6956a100 (patch) | |
| tree | e03e0cc41d3744fdc57c20393508bf18a472b0b6 /src/nvim/testdir | |
| parent | 0cd14303162df99bbd796002a44588aface2bad8 (diff) | |
| download | rneovim-d67dcaba02d76fe92ba818dde7b672fe6956a100.tar.gz rneovim-d67dcaba02d76fe92ba818dde7b672fe6956a100.tar.bz2 rneovim-d67dcaba02d76fe92ba818dde7b672fe6956a100.zip | |
vim-patch:8.2.2854: custom statusline cannot contain % items (#14558)
Problem: Custom statusline cannot contain % items.
Solution: Add "%{% expr %}". (closes vim/vim#8190)
https://github.com/vim/vim/commit/30e3de21fc36153c5f7c9cf9db90bcc60dd67fb9
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_statusline.vim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_statusline.vim b/src/nvim/testdir/test_statusline.vim index f5b6446108..a3e4dcdd25 100644 --- a/src/nvim/testdir/test_statusline.vim +++ b/src/nvim/testdir/test_statusline.vim @@ -241,6 +241,26 @@ func Test_statusline() call assert_match('^vimLineComment\s*$', s:get_statusline()) syntax off + "%{%expr%}: evaluates enxpressions present in result of expr + func! Inner_eval() + return '%n some other text' + endfunc + func! Outer_eval() + return 'some text %{%Inner_eval()%}' + endfunc + set statusline=%{%Outer_eval()%} + call assert_match('^some text ' . bufnr() . ' some other text\s*$', s:get_statusline()) + delfunc Inner_eval + delfunc Outer_eval + + "%{%expr%}: Doesn't get stuck in recursion + func! Recurse_eval() + return '%{%Recurse_eval()%}' + endfunc + set statusline=%{%Recurse_eval()%} + call assert_match('^%{%Recurse_eval()%}\s*$', s:get_statusline()) + delfunc Recurse_eval + "%(: Start of item group. set statusline=ab%(cd%q%)de call assert_match('^abde\s*$', s:get_statusline()) |