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

Intermittent crashes while scrolling #90

Closed
gshpychka opened this issue Jan 5, 2024 · 21 comments
Closed

Intermittent crashes while scrolling #90

gshpychka opened this issue Jan 5, 2024 · 21 comments

Comments

@gshpychka
Copy link
Contributor

Sometime, usually upon first loading a file and scrolling (while LSP is loading, I think), neovim silently crashes near the end of the scroll. How do I debug this - where should I look for the logs?

I am on MacOS, using neoscroll with the default config.

@richardso21
Copy link

richardso21 commented Jan 13, 2024

I have the same issue, seems to happen most often when I am spamming Ctrl-D/U to scroll through my code. No red error messages or anything, just kicks me back to the terminal and I have to start up nvim again. I've disabled the plugin for now and will report if the crashes continue or stop happening.

EDIT: The performance fix seen here #80 (comment) still does not fix this crashing issue...

@karb94
Copy link
Owner

karb94 commented Jan 19, 2024

Have you always experienced this or did this issue appear after a Neovim or Neoscroll update?

Is there any way to reproduce it? Unfortunately, I have never experienced this myself.

@gshpychka
Copy link
Contributor Author

Have you always experienced this or did this issue appear after a Neovim or Neoscroll update?

Is there any way to reproduce it? Unfortunately, I have never experienced this myself.

I can't say when it started appearing and unfortunately don't know a reliable way to reproduce this. I was hoping there would be logs somewhere that I could look at

@karb94
Copy link
Owner

karb94 commented Jan 22, 2024

What config are you using? If you see it happening with a particular config, e.g. when using easing functions, it might give us some clues.

@gshpychka
Copy link
Contributor Author

What config are you using? If you see it happening with a particular config, e.g. when using easing functions, it might give us some clues.

To add a bit of info - I have the same exact behavior as @richardso21, i.e. usually happens when spamming Ctrl-D/U quickly, and especially while LSP is loading (not sure about this one).

Regarding my config, I'm pretty sure it's the default one:

require("neoscroll").setup({
	-- All these keys will be mapped to their corresponding default scrolling animation
	mappings = { "<C-u>", "<C-d>", "<C-b>", "<C-f>", "<C-y>", "<C-e>", "zt", "zz", "zb" },
	hide_cursor = true, -- Hide cursor while scrolling
	stop_eof = true, -- Stop at <EOF> when scrolling downwards
	respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file
	cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further
	easing_function = nil, -- Default easing function
	pre_hook = nil, -- Function to run before the scrolling animation starts
	post_hook = nil, -- Function to run after the scrolling animation ends
	performance_mode = false, -- Disable "Performance Mode" on all buffers.
})

@richardso21
Copy link

Yes, spamming those keybinds while the LSP is loading usually spells trouble. This is my config with lazy.nvim (pretty barebones):

{
 	"karb94/neoscroll.nvim",
 	opts = {
 		easing_function = "sine",
	},
}

As for my lsp setup, I am using a combination of lsp-zero, mason, lspconfig, and nvim-cmp.

@edwardbaeg
Copy link

edwardbaeg commented Jan 31, 2024

I am also having this issue - sometimes crashing with c-d/u. However, I experience it randomly, not just during LSP loading.

My config is simply:

         require("neoscroll").setup({
            easing_function = "sine",
         })

@richardso21
Copy link

Update to this thread, I realize that this issue happens even when I am scrolling with my mouse wheel as well, even with this plugin removed. So if others experience this exact same thing as well, I think this is more of a neovim issue than it is neoscroll...

@edwardbaeg
Copy link

I can also add that I have seen this issue after replacing neoscroll with mini.animate, and so this issue is likely not just contained to neoscroll.

@karb94
Copy link
Owner

karb94 commented Feb 6, 2024

Can you pull the latest commit? It adds a pcall() to the scrolling function to handle any errors it may throw. This was done to fix another issue but could help here as well.

@richardso21
Copy link

Haven't pulled the latest commit yet, but on ~/.local/state/nvim/log I see:

ERR 2024-02-09T10:26:18.125 ?.4867     chan_close_with_error:653: RPC: (null)

That's all, and it occurs every time I crash when scrolling (neoscroll or not). I'm not sure if anyone else is also seeing this as well. I'm also using MacOS Sonoma (14) with Kitty terminal for your information.

@edwardbaeg
Copy link

edwardbaeg commented Feb 9, 2024

Yes, I am also seeing these messages in my log. And these occurred while using ctrl-{ / }.

ERR 2024-02-09T12:07:23.130 ?.44300    chan_close_with_error:653: RPC: (null)
ERR 2024-02-09T14:25:17.172 ?.87848    chan_close_with_error:653: RPC: (null)

I am going to switch back to neoscroll and see if the latest commit has fixed the issue.

@karb94
Copy link
Owner

karb94 commented Feb 9, 2024

@edwardbaeg I'm not sure how the ctrl-{ movement is tied to neoscroll as it is not animated by default. Did you map it to a scrolling animation?

@edwardbaeg
Copy link

@edwardbaeg I'm not sure how the ctrl-{ movement is tied to neoscroll as it is not animated by default. Did you map it to a scrolling animation?

I had recently switched over to try mini.animate to see if I could repro this issue and I was seeing the same problems. Sorry for the confusion, I forgot that neoscroll doesn't handle ctrl { }.

@richardso21
Copy link

Since it's also happening with mini.animate, I suppose this is a neovim issue? However, if I run nvim --clean and I begin scrolling quickly I never run into this issue again... Maybe some other common plugin is the culprit

@richardso21
Copy link

richardso21 commented Feb 16, 2024

After a very long time of investigating which plugin would be causing this (so long in fact that I don't want to admit it), I pinpointed the cause to be messages (especially lsp progress messages) displayed by noice.nvim and nvim-notify. I found a way to reproduce this crash somewhat consistently, and that is to scroll very very fast on a large file while lsp is loading.

My fix for this is to set lsp = { progress = false } in noice.nvim's config. However, I will also say that I am using Neovim stable 0.9.5 despite noice.nvim strongly suggesting I use nightly (for some reason I can't get it to install with homebrew).

UPDATE: I can't reproduce this issue anymore using neovim nightly, but I encountered more inconvenient unrelated bugs along the way so I'll be staying on stable with this fix for now 😅

@edwardbaeg
Copy link

I don't have noice.nvim or nvim-notify installed and I am still getting booted from nvim while scrolling :/. This includes the latest commit for neoscroll. I'll see if I have any plugins similar to those that might be causing this.

@karb94
Copy link
Owner

karb94 commented Mar 10, 2024

@edwardbaeg could you please try to reproduce this without any plugins other than nvim-lspconfig? Also pull latest commit as it prevents endless loops (see #95) although this mostly applies to files with wrapped lines.

@edwardbaeg
Copy link

@karb94 I have not experienced any similar crashes for the last week. This may have resolved itself. Maybe this was due to some bad interaction with another plugin that was updated recently

tats-tagawa-chime added a commit to tats-tagawa-chime/dotfiles that referenced this issue Apr 2, 2024
jmbeach pushed a commit to jmbeach/nvim-config that referenced this issue Apr 20, 2024
@gshpychka
Copy link
Contributor Author

This may have been caused at least in part by neovim/neovim#27859

@karb94
Copy link
Owner

karb94 commented Apr 24, 2024

I'll close this for now as it doesn't appear to be related to Neoscroll.

@karb94 karb94 closed this as completed Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants