Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Lualine is not refreshing on events/autocmds anymore #1358

Open
camoz opened this issue Jan 4, 2025 · 2 comments
Open

Bug: Lualine is not refreshing on events/autocmds anymore #1358

camoz opened this issue Jan 4, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@camoz
Copy link

camoz commented Jan 4, 2025

I would kindly suggest to reconsider the decision to remove refreshing on events/autocmds, which was done in 0978a6c.

IMO, a statusline in a text editor (like lualine) is a prime example for a program where an event-driven approach (refresh on autocmds) should be used instead of "static polling". Most statusline plugins support refreshing on autocmd events, which is necessary for a snappy user experience. The current refresh delay of 100 ms is very much noticable, as some people have noted in the comments to the above-mentioned commit. Remember that many users are using neovim because they prefer a lightweight and fast user experience!

This issue is intentionally labled as bug, because I'm convinced that in case support for refreshing on autocmds will not be re-added, lualine will become obsolete in the long term.

@camoz camoz added the bug Something isn't working label Jan 4, 2025
camoz referenced this issue Jan 4, 2025
* Fixup: fix flickering in lualine

debounce updates for 100ms while setting the options

todo: fix the test properly

* fix: delay in first set

Don't delay setting options when it's unset

* enhance: handle quick redraws better

When multiple redraws in debounce period just pick the most frequent one
with bias toward old one.

* fixup: No more refreshing on autocmd

Though refreshing on autocmd allows us to refresh less. But not always
for example when scrolling it can get pretty frequent refresh due to
CursorMoved. But this whole refresh on autocmd causes way too many bugs
due to various conflicts and inconsistencies.

Instead now lualine will only refresh on timer. To make lualine
resoponsive as before refresh time has been reduced to 100ms from 1s.
Means now lualine would refresh 10 times per second by default.

* fixup: fix 1st render delay after autocmd refresh removal

* fixup: fix error when trying to set options to already deleted buffer or window

* remove debounce
@orkhanM
Copy link

orkhanM commented Jan 7, 2025

I'm also having issues since this commit, the location line & column counter has become very laggy since this change.

Video of before and after update (note the location counter at the bottom right of the lualine layout as I scroll my cursor over a file):

Screencast.from.2025-01-06.23-14-12.webm

@HawkinsT
Copy link

Note that reverting commit 0978a6c will re-introduce the flickering issue. Unless given an example to the contrary, I believe #1076 to be the best solution, which removes the problematic refresh events without doing away with them entirely. Unfortunately, lualine doesn't seem to have a lot of active development these days so it may be a while before anyone has the opportunity to look at this (e.g. my pull request above was open for 15 months without being looked at until I closed it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants