Skip to content

Bug: Live plugin reload with Lazy causes symbol jumping #1483

@wh1le

Description

@wh1le

Self Checks

  • I'm using the latest lualine.
  • I didn't find the issue in existing issues or PRs.

How to reproduce the problem

It causessome of the elements to jump and redraw

Expected behaviour

When reloading the config during runtime with two windows open in a vertical split:

require("lazy").reload({ plugins = {"lualine.nvim"}})

It should reload config without any issue.

Actual behaviour

The git and other integrations start to jump or constantly re-initialize.

Image

Minimal config to reproduce the issue

return {
	"nvim-lualine/lualine.nvim",
	lazy = false,
	config = function()
		require("lualine").setup(options = {})
	end,
}

Additional information

Env:

  • NVIM v0.11.5
  • Lazy 11.17.5

Doing this multiple times cause to spawn some external processes that slows down neovim.

I attempted to fix it by running following commands:

local function reload_lualine()
	local lualine = require("lualine")

	lualine.hide({ unhide = false })


	if lualine.timer and lualine.timer:is_active() then
		lualine.timer:stop()
	end

	
	pcall(vim.api.nvim_del_augroup_by_name, "lualine")
	pcall(vim.api.nvim_del_augroup_by_name, "lualine_stl_refresh")

	for name, _ in pairs(package.loaded) do
		if name:match("^lualine") then
			package.loaded[name] = nil
		end
	end
	collectgarbage("collect")
	require("lazy").reload({ plugins = { "lualine.nvim" } })
end

My own use case: I use the pywal16 theme in Neovim and need to change colors on the fly, from light to dark theme, etc. I have an external function tied to a socket. When it receives a signal, it re-fetches new colors and applies them globally across Neovim. Lualine doesn't support this, so I'm either forced to use static colors or inherit them from the terminal, which is not optimal for me right now. Is there any way to completely disable all lualine hooks and triggers before reloading it? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions