diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-04 08:59:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-04 08:59:11 +0800 |
commit | 7c8c1550737b34fabb3e4cecbc6b6bf3581b2235 (patch) | |
tree | a38e081773f61f33df2fca85417f578ba92260e0 /test/functional/api/vim_spec.lua | |
parent | eb1da498d6af79b7856418d7df51ce584c621340 (diff) | |
download | rneovim-7c8c1550737b34fabb3e4cecbc6b6bf3581b2235.tar.gz rneovim-7c8c1550737b34fabb3e4cecbc6b6bf3581b2235.tar.bz2 rneovim-7c8c1550737b34fabb3e4cecbc6b6bf3581b2235.zip |
fix(api): avoid double hit-enter prompt with nvim_err_writeln (#22879)
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 9d5a0c4b4e..83347a499b 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -2080,6 +2080,46 @@ describe('API', function() end) end) + describe('nvim_err_writeln', function() + local screen + + before_each(function() + screen = Screen.new(40, 8) + screen:attach() + screen:set_default_attr_ids({ + [0] = {bold=true, foreground=Screen.colors.Blue}, + [1] = {foreground = Screen.colors.White, background = Screen.colors.Red}, + [2] = {bold = true, foreground = Screen.colors.SeaGreen}, + [3] = {bold = true, reverse = true}, + }) + end) + + it('shows only one return prompt after all lines are shown', function() + nvim_async('err_writeln', 'FAILURE\nERROR\nEXCEPTION\nTRACEBACK') + screen:expect([[ + | + {0:~ }| + {3: }| + {1:FAILURE} | + {1:ERROR} | + {1:EXCEPTION} | + {1:TRACEBACK} | + {2:Press ENTER or type command to continue}^ | + ]]) + feed('<CR>') + screen:expect([[ + ^ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]) + end) + end) + describe('nvim_list_chans, nvim_get_chan_info', function() before_each(function() command('autocmd ChanOpen * let g:opened_event = deepcopy(v:event)') |