diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-03-18 10:34:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-18 10:34:27 +0800 |
commit | eabf9de1dc8c8eeb8246491a0e389b5f9a5fde97 (patch) | |
tree | 8d09ddd851521f06dafe73ab8e2d7273786ed274 /test/functional/ui/messages_spec.lua | |
parent | 3b29b39e6deb212456eba691bc79b17edaa8717b (diff) | |
download | rneovim-eabf9de1dc8c8eeb8246491a0e389b5f9a5fde97.tar.gz rneovim-eabf9de1dc8c8eeb8246491a0e389b5f9a5fde97.tar.bz2 rneovim-eabf9de1dc8c8eeb8246491a0e389b5f9a5fde97.zip |
fix(messages): allow more prompt in headless mode with UI (#27905)
Problem: More prompt is not shown in headless mode even if there is a
UI attached.
Solution: Don't skip more prompt when there is a UI active.
Diffstat (limited to 'test/functional/ui/messages_spec.lua')
-rw-r--r-- | test/functional/ui/messages_spec.lua | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua index a4ed7268f4..6b71d85861 100644 --- a/test/functional/ui/messages_spec.lua +++ b/test/functional/ui/messages_spec.lua @@ -3,6 +3,7 @@ local Screen = require('test.functional.ui.screen') local clear, feed = helpers.clear, helpers.feed local eval = helpers.eval local eq = helpers.eq +local neq = helpers.neq local command = helpers.command local set_method_error = helpers.set_method_error local api = helpers.api @@ -15,6 +16,7 @@ local exc_exec = helpers.exc_exec local exec_lua = helpers.exec_lua local poke_eventloop = helpers.poke_eventloop local assert_alive = helpers.assert_alive +local retry = helpers.retry local is_os = helpers.is_os local is_ci = helpers.is_ci local fn = helpers.fn @@ -2497,3 +2499,47 @@ aliquip ex ea commodo consequat.]] } end) end) + +it('pager works in headless mode with UI attached', function() + skip(is_os('win')) + clear() + local child_server = assert(helpers.new_pipename()) + fn.jobstart({ nvim_prog, '--clean', '--headless', '--listen', child_server }) + retry(nil, nil, function() + neq(nil, vim.uv.fs_stat(child_server)) + end) + + local child_session = helpers.connect(child_server) + local child_screen = Screen.new(40, 6) + child_screen:attach(nil, child_session) + + child_session:notify('nvim_command', [[echo range(100)->join("\n")]]) + child_screen:expect([[ + 0 | + 1 | + 2 | + 3 | + 4 | + -- More --^ | + ]]) + + child_session:request('nvim_input', 'G') + child_screen:expect([[ + 95 | + 96 | + 97 | + 98 | + 99 | + Press ENTER or type command to continue^ | + ]]) + + child_session:request('nvim_input', 'g') + child_screen:expect([[ + 0 | + 1 | + 2 | + 3 | + 4 | + -- More --^ | + ]]) +end) |