nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.
MIT License
6.22k stars 468 forks source link

Bug: High cpu usage on O-PENDING mode #967

Open mhdna opened 1 year ago

mhdna commented 1 year ago

Self Checks

How to reproduce the problem

In normal mode, press any pending operator (e.g. d, c, or y) without pressing the waiting movement command (i.e. press d without j for example).

Expected behaviour

Normal cpu usage.

Actual behaviour

Neovim is the top cpu consumer.

Minimal config to reproduce the issue

require('lualine').setup()

shadmansaleh commented 1 year ago

This occurs because of a bug in neovim https://github.com/neovim/neovim/issues/22263

I've added a mitigation so lualine doesn't trigger this bug. https://github.com/nvim-lualine/lualine.nvim/commit/2ac8d77575926d5c22f1d13f3e48000d579277e3

For now, lualine no longer schedules the ModeChanged events for operating pending mode. But this also means lualine no longer refreshes when user enters op-pending mode. But at least you should no longer hit 100% CPU uses when you enter op-pending mode.

mhdna commented 1 year ago

@shadmansaleh Thanks for the quick mitigation.

Hopefully the nvim team gets this resolved soon.

mhdna commented 1 year ago

Hi again,

Now that the https://github.com/neovim/neovim/issues/22263 issue got resolved, isn't it time to remove this temporary mitigation so that lualine refreshes properly when it enters O-PENDING mode?