RaafatTurki / corn.nvim

LSP diagnostics at your corner
107 stars 8 forks source link

Very Slow Typing With LSP Stuff (Rust) #11

Open pati08 opened 5 months ago

pati08 commented 5 months ago

Every keypress in insert mode with Rust Analyzer results in corn re-rendering, which seems to block all of neovim and make switching lines or typing insanely slow. I'm going to disable it because of this. With corn disabled, it does not lag so much. I believe that Corn does its rendering relatively slowly and in a way that holds everything up while it does its thing.

pati08 commented 5 months ago

For now, I'm going to just disable it in insert mode, probably.

RaafatTurki commented 5 months ago

Hmm, corn re-renders when any of the following autocmds are triggered

"DiagnosticChanged",
"CursorMoved",
"CursorMovedI",
"TextChanged",
"TextChangedI",
"WinResized",
"ModeChanged",

I will look into making the render cycle non-blocking. Perhaps also add a configurable throttle and implement a less aggressive re-rendering logic.

Thanks for your feedback!

pati08 commented 5 months ago

Thanks, sounds good. If I knew more Lua, I might make a PR to help lol :)

vunhatchuong commented 3 months ago

Having the same problem in Python. After a while of coding, it becomes laggy and I have to reopen nvim to get rid of the lag.