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

Scrolling using vim-smoothie lags when lualine.nvim is enabled #1

Closed
bool3max opened this issue Dec 30, 2020 · 12 comments
Closed

Scrolling using vim-smoothie lags when lualine.nvim is enabled #1

bool3max opened this issue Dec 30, 2020 · 12 comments
Labels
bug Something isn't working

Comments

@bool3max
Copy link

bool3max commented Dec 30, 2020

  • nvim --version:
NVIM v0.5.0-dev+972-g84faeb07d
Build type: RelWithDebInfo
LuaJIT 2.0.5
  • latest versions of both plugins
  • terminal: kitty 0.19.3 (also occurs in xterm)

Scrolling using vim-smoothie while lualine.nvim is enabled produces lag, especially towards the end of the scrolling motion. This does not occur while using vim-airline (though lualine.nvim is the first statusline plugin I've ever used, but I had to test with another one).

@bool3max
Copy link
Author

bool3max commented Dec 30, 2020

It is less noticeable (though still apparent) using the default scroll speed (let g:smoothie_update_interval=10), but when using let g:smoothie_update_interval=5, a slower scroll speed, it becomes immediately apparent. The last few lines to-be-scrolled take a second to go by.

@hoob3rt
Copy link
Contributor

hoob3rt commented Dec 30, 2020

This does not happen on my system unless I set g:smoothie_update_interval=1, even on xterm.
Keep in my that vim-smoothie is really cpu heavy as shown below
screen
But no lag happens when lualine.nvim is not installed so this is definitely an issue, I will try to resolve this asap.

@bool3max
Copy link
Author

bool3max commented Dec 30, 2020

Yeah the less delay between updates the more lag there is, without lualine I can get a very smooth motion with it set to 5, with it not so much. I love the plugin, hope you get it resolved!

@hoob3rt
Copy link
Contributor

hoob3rt commented Dec 30, 2020

can you try setting up lualine this way?

require('lualine').sections = {
  lualine_a = { 'mode' },
  -- lualine_b = { 'branch' },
  lualine_c = { 'filename' },
  lualine_x = { 'encoding', 'fileformat', 'filetype' },
  lualine_y = { 'progress' },
  lualine_z = { 'location'  },
}

I think the branch function might be a problem

@bool3max
Copy link
Author

Using that I get this:

image

@hoob3rt
Copy link
Contributor

hoob3rt commented Dec 30, 2020

try this way

    local lualine = require('lualine')
    lualine.sections = {
      lualine_a = { 'mode' },
      -- lualine_b = { 'branch' },
      lualine_c = { 'filename' },
      lualine_x = { 'encoding', 'fileformat', 'filetype' },
      lualine_y = { 'progress' },
      lualine_z = { 'location'  },
    }
    lualine.status()

@bool3max
Copy link
Author

Yeah that works, it doesn't lag anymore!

@hoob3rt
Copy link
Contributor

hoob3rt commented Dec 30, 2020

Great! Thanks for pointing that out. I know why this is happening but I have a more universal fix in mind than just fixing the branch function.

Some functions like branch, fileformat should probably only run once per file, not on every update like this is happenig like now.
I will try to resolve this next friday. You can keep using lualine without the branch functionality for now or try creating a pr.

@eric-hansen
Copy link

I'm not super familiar with the Lua API but why not make the calls async with vim.loop instead?

@hoob3rt
Copy link
Contributor

hoob3rt commented Dec 31, 2020

I'm not super familiar with the Lua API but why not make the calls async with vim.loop instead?

Yes function like branch have to be made async as well. Thanks for pointing vim.loop out, it looks like it could be an easy to implement solution.

eric-hansen added a commit to eric-hansen/lualine.nvim that referenced this issue Dec 31, 2020
@hoob3rt hoob3rt added the bug Something isn't working label Jan 2, 2021
@hoob3rt
Copy link
Contributor

hoob3rt commented Jan 3, 2021

could you confirm if f62c0d4 solves this issue?

@bool3max
Copy link
Author

bool3max commented Jan 4, 2021

yeah, seems to be fixed, nice.

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