mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
feat(messages): "g<" mapping for ext_messages
Problem: Cannot use "g<" mapping with ext_messages. Mapping displays
the scrollback buffer since the last command, but the
scrollback buffer is not populated with ext_messages.
Solution: With ext_messages; store messages in the history that otherwise
wouldn't be. Mark them as temporary messages to be deleted when
the scrollback buffer would be cleared. To this end, make the
message history a doubly-linked list such that messages can be
removed from an arbitrary position.
Outlook: Default ext_messages UI might not show the hit-enter prompt
so we want "g<" to work as a recommended way to show messages
for the last command (prompted by an indicator).
This commit is contained in:
@@ -1571,6 +1571,48 @@ stack traceback:
|
||||
end,
|
||||
})
|
||||
end)
|
||||
|
||||
it('g< mapping shows recent messages', function()
|
||||
command('echo "foo" | echo "bar"')
|
||||
local s1 = [[
|
||||
^ |
|
||||
{1:~ }|*4
|
||||
]]
|
||||
screen:expect({
|
||||
grid = s1,
|
||||
messages = {
|
||||
{
|
||||
content = { { 'bar' } },
|
||||
history = false,
|
||||
kind = 'echo',
|
||||
},
|
||||
},
|
||||
})
|
||||
feed(':messages<CR>g<lt>')
|
||||
screen:expect({
|
||||
grid = [[
|
||||
^ |
|
||||
{1:~ }|*4
|
||||
]],
|
||||
messages = {
|
||||
{
|
||||
content = { { 'Press ENTER or type command to continue', 6, 18 } },
|
||||
history = false,
|
||||
kind = 'return_prompt',
|
||||
},
|
||||
},
|
||||
msg_history = {
|
||||
{
|
||||
content = { { 'foo' } },
|
||||
kind = 'echo',
|
||||
},
|
||||
{
|
||||
content = { { 'bar' } },
|
||||
kind = 'echo',
|
||||
},
|
||||
},
|
||||
})
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('ui/builtin messages', function()
|
||||
|
||||
Reference in New Issue
Block a user