Closed chrisgrieser closed 1 year ago
Hi @chrisgrieser. Thanks for reporting the issue.
I'm unable to reproduce the problem. When I launch Neovim configured only with the snippet of code you provided, nvim-scrollview
functions as expected.
If you only include that snippet of code in your config (omitting all other configuration code), do you still encounter the issue?
yes, the issue also occurs with nothing but nvim-scrollview and the snippet in my config :/
here my version information in case it helps? 🤔
macOS 13.3.1 (M1)
neovim 0.9.0 (homebrew)
Neovide 0.10.4 (homebrew)
I can now reproduce. I was originally only looking at the scrollbar signs, which still are displayed for me. But I can now see that the search pattern is not highlighted.
nvim-scrollview
calls :normal!
while updating scrollbars, which triggers the vim.on_key
function.
I've added a global variable, g:scrollview_refreshing
, that gets set to v:true
while scrollbars are being refreshed (a0ae5f9, 02d0880).
With that update, a workaround is to have your function ignore keys while scrollview is refreshing.
vim.on_key(function(char)
if vim.g.scrollview_refreshing then return end
...
thanks! can confirm that this does fix the issue 😊
This is kind off more a request for support than a bug report, but since a bunch of people have such a "auto-nohl" snippet, it is probably relevant to more people than just me
So I use the following snippet to automatically set
:nohl
when I am using a non-search key (notn
/N
etc.) and automatically enable search highlights when I do a search:however, when I have nvim-scrollview as well as that snippet active, pressing
n
results in the highlights (and the search signs in the scrollbar) briefly appearing and than disappearing. I would guess it is because nvim-scrollview presses some key behind the scenes somewhere?Would it be possible to make this plugin compatible with the auto-nohl snippet or give some advice on how the snippet has to be changed to work together with this plugin?