Skip to content

some messages are skipped when sent at the same time #28

@antoinemadec

Description

@antoinemadec

issue

When messages are sent at the same time (with events or with async like in mason.nvim), multiple messages sometimes "collide" and overwrite one another to only leave the newest appear.

ui.nvim history is also approximative in that case and does not match vim's :messages anymore.

reproduction

nvim --clean -u init.lua init.lua, where init.lua is:

vim.opt.updatetime     = 100

local function notify(msg, level)
  level = level or vim.log.levels.INFO
  vim.notify(msg, level, {})
end

vim.api.nvim_create_autocmd("CursorHold", {
    pattern = "*",
    callback = function() notify("bar0 was successfully uninstalled.") end,
})
vim.api.nvim_create_autocmd("CursorHold", {
    pattern = "*",
    callback = function() notify("bar1 was successfully uninstalled.") end,
})
vim.api.nvim_create_autocmd("CursorHold", {
    pattern = "*",
    callback = function() notify("bar2 was successfully uninstalled.") end,
})
vim.api.nvim_create_autocmd("CursorHold", {
    pattern = "*",
    callback = function() notify("bar3 was successfully uninstalled.") end,
})

-- ui.nvim
vim.opt.rtp:prepend("$PWD")
require("ui").setup({})

Then use j and k to move around and see the problems described in the issue section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions