aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/messages_spec.lua
diff options
context:
space:
mode:
authorluukvbaal <luukvbaal@gmail.com>2024-06-04 15:09:12 +0200
committerGitHub <noreply@github.com>2024-06-04 06:09:12 -0700
commitb66106a46c5c6180c7f80852a8c822b400e73100 (patch)
tree3ea46b835fbbd014a719fdab42487385843b5225 /test/functional/ui/messages_spec.lua
parent8cbb1f20e557461c8417583a7f69d53aaaef920b (diff)
downloadrneovim-b66106a46c5c6180c7f80852a8c822b400e73100.tar.gz
rneovim-b66106a46c5c6180c7f80852a8c822b400e73100.tar.bz2
rneovim-b66106a46c5c6180c7f80852a8c822b400e73100.zip
fix(ui): superfluous showmode / excessive grid_cursor_goto #29089
Problem: Unsetting global variables earlier in #28578 to avoid recursiveness, caused superfluous or even unlimited showmode(). Solution: Partly revert #28578 so that the globals are unset at the end of showmode(), and avoid recursiveness for ext UI by adding a recursive function guard to each generated UI call that may call a Lua callback.
Diffstat (limited to 'test/functional/ui/messages_spec.lua')
-rw-r--r--test/functional/ui/messages_spec.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index ca52a265fa..07192800e5 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -1081,6 +1081,22 @@ stack traceback:
},
})
end)
+
+ it('does not do showmode unnecessarily #29086', function()
+ local screen_showmode = screen._handle_msg_showmode
+ local showmode = 0
+ screen._handle_msg_showmode = function(...)
+ screen_showmode(...)
+ showmode = showmode + 1
+ end
+ screen:expect({
+ grid = [[
+ ^ |
+ {1:~ }|*4
+ ]],
+ })
+ eq(showmode, 1)
+ end)
end)
describe('ui/builtin messages', function()