karb94/neoscroll.nvim

Error in terminal model

stevanmilic opened this issue · 2 comments

Sometimes when I'm in terminal mode, I'm getting below error:

Error executing vim.schedule lua callback: ...al/share/nvim/lazy/neoscroll.nvim/lua/neoscroll/init.lua:140: nvim_exec(): Vim(normal):Can't re-enter normal mode from terminal mode
stack traceback:
	[C]: in function 'cmd'
	...al/share/nvim/lazy/neoscroll.nvim/lua/neoscroll/init.lua:140: in function 'scroll_one_line'
	...al/share/nvim/lazy/neoscroll.nvim/lua/neoscroll/init.lua:315: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>

It usually happens when there's an output that is being constantly added to the terminal output, so it could be the scroll can't keep up. I'm also using toggleterm, so it could be that it's maintaining a cursor that isn't compatible with neoscroll.

Is it possible to turn off neoscroll in terminal buffers? That would help remedy the issue, but I'm not sure what's the root cause.

@karb94 I've made a PR to handle the error gracefully, it would be great if you could take a look 🙏🏻

karb94 commented

Thank you again for your PR!