aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/messages_spec.lua
diff options
context:
space:
mode:
authorluukvbaal <luukvbaal@gmail.com>2025-01-03 17:25:06 +0100
committerGitHub <noreply@github.com>2025-01-03 08:25:06 -0800
commit21718c67dd9625c53d519a63725db55be6abe2ff (patch)
tree9624f56b55225c7fef1864024d25a12af137f4b4 /test/functional/ui/messages_spec.lua
parentc26951b1d6d4d7ff8fe431e8bfb16744ff56af1c (diff)
downloadrneovim-21718c67dd9625c53d519a63725db55be6abe2ff.tar.gz
rneovim-21718c67dd9625c53d519a63725db55be6abe2ff.tar.bz2
rneovim-21718c67dd9625c53d519a63725db55be6abe2ff.zip
fix(messages): better formatting for ext_messages #31839
Problem: Message grid newline formatting based on `msg_col` is not utilized with ext_messages. Solution: Increment `msg_col` with the cell width of the chunk. Allowing message code that uses `msg_col` to determine when to place a newline to do so. E.g. when the message goes beyond `Columns`; this is not necessarily where the ext_messages implementation would want to place a newline, but it is a best guess. Message parsing and manipulation is still possible.
Diffstat (limited to 'test/functional/ui/messages_spec.lua')
-rw-r--r--test/functional/ui/messages_spec.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index 1e51652c4f..77ffc475b0 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -1121,7 +1121,7 @@ stack traceback:
]],
messages = {
{
- content = { { 'wildmenu wildmode' } },
+ content = { { 'wildmenu wildmode\n' } },
history = false,
kind = 'wildlist',
},
@@ -1335,6 +1335,21 @@ stack traceback:
feed('i')
n.assert_alive()
end)
+
+ it(':digraph contains newlines', function()
+ command('digraph')
+ screen:expect({
+ condition = function()
+ local nl = 0
+ eq('list_cmd', screen.messages[1].kind)
+ for _, chunk in ipairs(screen.messages[1].content) do
+ nl = nl + (chunk[2]:find('\n') and 1 or 0)
+ end
+ eq(682, nl)
+ screen.messages = {}
+ end,
+ })
+ end)
end)
describe('ui/builtin messages', function()