aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/screen.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-10-09 16:14:37 +0800
committerGitHub <noreply@github.com>2023-10-09 16:14:37 +0800
commitf96f8566b5f7997266264ba94a22844d9bc22699 (patch)
treecf6751bc06fb043ecd53d57d1dac5eeb8f8eb0b1 /test/functional/ui/screen.lua
parentdadc06ced268b0ec3b5ce5796be0af78cd387cbb (diff)
downloadrneovim-f96f8566b5f7997266264ba94a22844d9bc22699.tar.gz
rneovim-f96f8566b5f7997266264ba94a22844d9bc22699.tar.bz2
rneovim-f96f8566b5f7997266264ba94a22844d9bc22699.zip
test(ui/embed_spec): use notification instead of request (#25555)
This avoid the hang mentioned in #24888, and also matches TUI better.
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r--test/functional/ui/screen.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index be7c2f291c..d3ffb07749 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -150,6 +150,7 @@ function Screen.new(width, height)
msg_grid = nil,
msg_grid_pos = nil,
_session = nil,
+ rpc_async = false,
messages = {},
msg_history = {},
showmode = {},
@@ -173,9 +174,13 @@ function Screen.new(width, height)
_busy = false,
}, Screen)
local function ui(method, ...)
- local status, rv = self._session:request('nvim_ui_'..method, ...)
- if not status then
- error(rv[2])
+ if self.rpc_async then
+ self._session:notify('nvim_ui_'..method, ...)
+ else
+ local status, rv = self._session:request('nvim_ui_'..method, ...)
+ if not status then
+ error(rv[2])
+ end
end
end
self.uimeths = create_callindex(ui)