dstein64 / nvim-scrollview

A Neovim plugin that displays interactive vertical scrollbars and signs.
MIT License
563 stars 10 forks source link

Refresh mappings conflict with buffer-local mappings #109

Closed dstein64 closed 1 year ago

dstein64 commented 1 year ago

Refresh mappings are created only if there are no conflicting mappings.

https://github.com/dstein64/nvim-scrollview/blob/dc236a2e6503f46598554d0955fe897dbcfa4807/autoload/scrollview.vim#L14-L32

However, this doesn't account for buffer local mappings, which would typically be created after the scrollview mappings, when some buffer is loaded.

For example a problem arises for NERDTree, whose buffers have a buffer-local mappings for m. Since scrollview mappings have already been created that begin with m, there is a delay in NERDTree buffers when trying to use the m mapping. This issue was reported by @evmorov in #107.

dstein64 commented 1 year ago

This is fixed in 71d3b6edbc21cbec14c9d4e88c50792a9efaf14e. Instead of using mappings, the plugin now relies on vim.on_key. @evmorov, using m in NERDTree should now work as expected.

evmorov commented 1 year ago

Thanks @dstein64! I confrim that it works.