mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
fix(messages): add append parameter to history entries (#34467)
Problem: The "append" parameter added in abb40ece
is missing from
history entries, resulting in different message formatting
for "g<".
Solution: Add "append" field to message history entries.
Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
This commit is contained in:
@ -136,9 +136,9 @@ describe('vim.ui_attach', function()
|
||||
{
|
||||
'msg_history_show',
|
||||
{
|
||||
{ 'echomsg', { { 0, 'message1', 0 } } },
|
||||
{ 'lua_print', { { 0, 'message2', 0 } } },
|
||||
{ 'echomsg', { { 0, 'message3', 0 } } },
|
||||
{ 'echomsg', { { 0, 'message1', 0 } }, false },
|
||||
{ 'lua_print', { { 0, 'message2', 0 } }, false },
|
||||
{ 'echomsg', { { 0, 'message3', 0 } }, false },
|
||||
},
|
||||
},
|
||||
}, actual, vim.inspect(actual))
|
||||
|
@ -1604,14 +1604,21 @@ stack traceback:
|
||||
end)
|
||||
|
||||
it('g< mapping shows recent messages', function()
|
||||
command('echo "foo" | echo "bar"')
|
||||
feed(':echo "foo" | echo "bar" | echon "baz"<CR>')
|
||||
screen:expect({
|
||||
grid = [[
|
||||
^ |
|
||||
{1:~ }|*4
|
||||
]],
|
||||
cmdline = { { abort = false } },
|
||||
messages = {
|
||||
{ content = { { 'foo' } }, kind = 'echo' },
|
||||
{ content = { { 'bar' } }, kind = 'echo' },
|
||||
{ content = { { 'baz' } }, kind = 'echo', append = true },
|
||||
{
|
||||
content = { { 'Press ENTER or type command to continue', 6, 18 } },
|
||||
kind = 'return_prompt',
|
||||
},
|
||||
},
|
||||
})
|
||||
feed('g<lt>')
|
||||
@ -1627,14 +1634,9 @@ stack traceback:
|
||||
},
|
||||
},
|
||||
msg_history = {
|
||||
{
|
||||
content = { { 'foo' } },
|
||||
kind = 'echo',
|
||||
},
|
||||
{
|
||||
content = { { 'bar' } },
|
||||
kind = 'echo',
|
||||
},
|
||||
{ content = { { 'foo' } }, kind = 'echo' },
|
||||
{ content = { { 'bar' } }, kind = 'echo' },
|
||||
{ content = { { 'baz' } }, kind = 'echo', append = true },
|
||||
},
|
||||
})
|
||||
feed('Q')
|
||||
|
@ -1515,7 +1515,11 @@ function Screen:_extstate_repr(attr_state)
|
||||
|
||||
local msg_history = {}
|
||||
for i, entry in ipairs(self.msg_history) do
|
||||
msg_history[i] = { kind = entry[1], content = self:_chunks_repr(entry[2], attr_state) }
|
||||
msg_history[i] = {
|
||||
kind = entry[1],
|
||||
content = self:_chunks_repr(entry[2], attr_state),
|
||||
append = entry[3] or nil,
|
||||
}
|
||||
end
|
||||
|
||||
local win_viewport = (next(self.win_viewport) and self.win_viewport) or nil
|
||||
|
Reference in New Issue
Block a user