From 0570a19c8a84debcdf2bc73f4c5f2d7d9de3ead2 Mon Sep 17 00:00:00 2001 From: bfredl Date: Thu, 14 Mar 2024 10:03:59 +0100 Subject: fix(intro): make intro explicitly stateful Instead of randomly disappearing because some random event might have caused mid_start or bot_scroll_start to randomly take a low value, treat intro message as a _first class stateful_ thing. This means that intro message will kept being _redrawn_ as long as we are in the state it should be shown. This also includes screen resizes. you will not lose the intro message because there was a delay in detecting terminal features. --- test/functional/ui/messages_spec.lua | 44 ++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua index c18a07fef0..131622bcc5 100644 --- a/test/functional/ui/messages_spec.lua +++ b/test/functional/ui/messages_spec.lua @@ -1627,13 +1627,41 @@ describe('ui/ext_messages', function() {1:~ }|*5 ]]) - feed('') - screen:expect([[ + -- (same as :mode) does _not_ clear intro message + feed('i') + screen:expect { + grid = [[ ^ | + {1:~ }|*4 + {MATCH:.*}| + {1:~ }| + {1:~ }Nvim is open source and freely distributable{1: }| + {1:~ }https://neovim.io/#chat{1: }| + {1:~ }| + {1:~ }type :help nvim{5:} if you are new! {1: }| + {1:~ }type :checkhealth{5:} to optimize Nvim{1: }| + {1:~ }type :q{5:} to exit {1: }| + {1:~ }type :help{5:} for help {1: }| + {1:~ }| + {1:~{MATCH: +}}type :help news{5:} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}| + {1:~ }| + {MATCH:.*}|*2 + {1:~ }|*5 + ]], + showmode = { { '-- INSERT --', 3 } }, + } + + -- but editing text does.. + feed('x') + screen:expect { + grid = [[ + x^ | {1:~ }|*23 - ]]) + ]], + showmode = { { '-- INSERT --', 3 } }, + } - feed(':intro') + feed(':intro') screen:expect { grid = [[ ^ | @@ -1657,6 +1685,14 @@ describe('ui/ext_messages', function() { content = { { 'Press ENTER or type command to continue', 4 } }, kind = 'return_prompt' }, }, } + + feed('') + screen:expect { + grid = [[ + ^x | + {1:~ }|*23 + ]], + } end) it('supports global statusline', function() -- cgit