fix(ui2): incomplete :echon message in g< pager #37819

Problem:
`:echo 1 | echon 2<cr>g<` shows "2", but should be "12".

Solution:
Don't clear temp msg (g<) if we are appending.
This commit is contained in:
phanium
2026-02-13 00:10:37 +08:00
committed by GitHub
parent e8ace82093
commit 179e7fccd7
3 changed files with 35 additions and 2 deletions

View File

@@ -255,7 +255,9 @@ function M.show_msg(tar, content, replace_last, append, id)
for _, chunk in ipairs(content) do
msg = msg .. chunk[2]
end
dupe = (not extid and msg == M.prev_msg and ui.cmd.srow == 0 and M.dupe + 1 or 0)
dupe = (
not extid and not append and msg == M.prev_msg and ui.cmd.srow == 0 and M.dupe + 1 or 0
)
end
cr = next(M[tar].ids) ~= nil and msg:sub(1, 1) == '\r'