Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refresh lualine based on timer + winbar support. (#736)
* feat: refresh lualine based on timer. * fix config test * fix lag on win change issue * handle errors in timer callback * feat: add winbar support Pull in winbar changes form pr #689 and adapt them Co-authored-by: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com> * make winbar disapear when winbar evals empty * only update stl of curwin with globalstatus * properly clear win local stl and wbr opts * add version guards for winbar feature * only add winbar if height > 1 * fix tests? * refresh lualine on ModeChanged event * ignore floating windows for refresh * properply restore options to previous state * fix stl not updating in cmd mode + some optimizations * fix tests on <nvim-0.7 * merge status_dispatch & winbar_dispatch + winbar support for extensions * fix globalstatus option not live updating * update docs * feat: allow disabling winbar and statusline separately * fix tests * fix: winbar some times oddly throwing errors about not having space in floating windows. This implements a temporary workaround the issue(neovim/neovim#19464) until the bug in neovim gets fixed. Co-authored-by: Diego Fujii <android.mxdiego9@gmail.com>
- Loading branch information
53aa3d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit causes native Neovim startup messages to appear and disappear quickly, like a quick flash
2022-07-23.03-13-23.mp4
53aa3d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also affect start screen plugins like alpha-nvim, the naive startup message quickly flashed before alpha-nvim is loaded.
53aa3d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ofseed fixed in 6fbc35b
53aa3d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit causes that the statusline in the window of
LeaderF
will be replaced by my customlualine
. But if I configed likedisabled_filetypes .statusline = {"leaderf"}
, the statusline in the window ofLeaderF
will disappear, neither stausline ofLeaderF
nor my customlualine
displayed any more.53aa3d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why but this commit causes CursorHold autocommands to stop working.
53aa3d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MSDimos maybe we're taking over the stl before leaderF is setting it's filetype option. I'll check it . Does leaderF expose what they want user to see in statusline so user can set it themselve? If they do you can easily use that to have a custom lualine extension.
@plax-00 We don't interact with CursorHold if CursorHold breaks after this it might be a bug in neovim. What autocommand did you have on CursorHold that stopped working ?
53aa3d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plax-00 check if 2d6108e fixed your issue.
53aa3d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MSDimos Your issue has been fixed in e9b05e7
53aa3d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shadmansaleh I have one for clearing the command line
echo ''
and one for LSP diagnostic floating windowslua vim.diagnostic.open_float()
.I tried 2d6108e and the most recent commit (7888057) and it's still not working for me.
53aa3d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plax-00 I can't reproduce it . Just tried adding a CursorHold auto command for
vim.diagnostic.open_float()
and it works fine.53aa3d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shadmansaleh After changing around my settings, it seems like it has to do with
updatetime
. I had it set to 1000. At 995-997, CursorHold still works but takes much longer than a second. At 998, it took several minutes. I have it set to 990 now and it works fine, but it seems like this is messing withupdatetime
in some way.53aa3d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plax-00 It's because of this upstream issue neovim/neovim#12587 . It seems CursorHold and CursorHoldI events are broken with timers.
Try using https://github.com/antoinemadec/FixCursorHold.nvim as workaround . I've had it installed for so long that I even forgot what it did. That would explain why I couldn't reproduce the cursorhold issue.
53aa3d8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok, thanks