mirror of
https://github.com/neovim/neovim.git
synced 2025-11-03 09:14:24 +00:00
feat(ui): specify whether msg_show event is added to history
Pass along whether message in msg_show event is added to the internal :messages history.
This commit is contained in:
@@ -1369,12 +1369,12 @@ function Screen:_handle_wildmenu_hide()
|
||||
self.wildmenu_items, self.wildmenu_pos = nil, nil
|
||||
end
|
||||
|
||||
function Screen:_handle_msg_show(kind, chunks, replace_last)
|
||||
function Screen:_handle_msg_show(kind, chunks, replace_last, history)
|
||||
local pos = #self.messages
|
||||
if not replace_last or pos == 0 then
|
||||
pos = pos + 1
|
||||
end
|
||||
self.messages[pos] = { kind = kind, content = chunks }
|
||||
self.messages[pos] = { kind = kind, content = chunks, history = history }
|
||||
end
|
||||
|
||||
function Screen:_handle_msg_clear()
|
||||
@@ -1490,7 +1490,11 @@ function Screen:_extstate_repr(attr_state)
|
||||
|
||||
local messages = {}
|
||||
for i, entry in ipairs(self.messages) do
|
||||
messages[i] = { kind = entry.kind, content = self:_chunks_repr(entry.content, attr_state) }
|
||||
messages[i] = {
|
||||
kind = entry.kind,
|
||||
content = self:_chunks_repr(entry.content, attr_state),
|
||||
history = entry.history,
|
||||
}
|
||||
end
|
||||
|
||||
local msg_history = {}
|
||||
|
||||
Reference in New Issue
Block a user