dstein64 / nvim-scrollview

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

Bug: `m` keymappings lag due to ScrollView keybinding #93

Closed chrisgrieser closed 1 year ago

chrisgrieser commented 1 year ago

I have remapped m to % and with this plugin installed, any usage of m resulted in a noticable lag.

Looking into it, it seems that this lag is created by the m{letter} mappings set by this plugin.

Essentially, that part of the code assumes that users have not remapped m to something other than mark-movement, which often is not the case. Furthermore, these mappings are created, even though I do not have included "marks" in my list of signgroups for this plugin.

A potential solution might be to add conditionals for the presence of "marks" in the list of enabled signgroups, and m not being remapped before the m{letter} keymaps are created by this plugin

dstein64 commented 1 year ago

Thanks for debugging and reporting the issue!

There's now an option scrollview_marks_create_mappings that controls whether the mark mappings are created. This defaults to v:false when there is an existing m mapping.

Another workaround for lagging mappings is to add <nowait> (documented under :help :map-nowait) when generating the mapping, assuming it wouldn't be problematic if this prevents some mappings that use the same key prefix.

chrisgrieser commented 1 year ago

thanks, can confirm that it works!