fix(ui2): correct buffer reference in msg:start_timer() (#38600)

Problem:  Mixing "buf" and "M.bufs.msg" in M.msg:start_timer().
          Cannot run `require("vim._core.ui2").enable(nil)`.
Solution: Replace "M.bufs.msg" with "buf". Allow `opts == nil`.

Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
(cherry picked from commit f50e7d8205)
This commit is contained in:
Ayush Goyal
2026-03-30 22:06:45 +05:30
committed by github-actions[bot]
parent edf4f5689d
commit b924afb36b

View File

@@ -67,7 +67,7 @@ function M.msg:start_timer(buf, id)
-- Remove message (including potentially leftover empty line).
api.nvim_buf_set_text(buf, mark[1], mark[2], mark[3].end_row, mark[3].end_col, {})
if api.nvim_buf_get_lines(ui.bufs.msg, mark[1], mark[1] + 1, false)[1] == '' then
if api.nvim_buf_get_lines(buf, mark[1], mark[1] + 1, false)[1] == '' then
api.nvim_buf_set_lines(buf, mark[1], mark[1] + 1, false, {})
end