Skip to content

Commit

Permalink
Remove <silent> from mappings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dstein64 committed Jan 5, 2021
1 parent 64de102 commit f729b1d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
16 changes: 8 additions & 8 deletions doc/scrollview.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,27 +149,27 @@ Synchronization Issues ~
is triggered by the window arrangement actions. |:ScrollViewRefresh|, or
scrolling can be used to refresh the scrollbars.
- Workaround: Remap the problematic key sequences accordingly. >
nmap <silent> <c-w>H <c-w>H<plug>(ScrollViewRefresh)
nmap <silent> <c-w>J <c-w>J<plug>(ScrollViewRefresh)
nmap <silent> <c-w>K <c-w>K<plug>(ScrollViewRefresh)
nmap <silent> <c-w>L <c-w>L<plug>(ScrollViewRefresh)
nmap <c-w>H <c-w>H<plug>(ScrollViewRefresh)
nmap <c-w>J <c-w>J<plug>(ScrollViewRefresh)
nmap <c-w>K <c-w>K<plug>(ScrollViewRefresh)
nmap <c-w>L <c-w>L<plug>(ScrollViewRefresh)
< This won't resolve the issue in all cases (e.g., when using |:wincmd|).

* Scrollbars become out-of-sync when the mouse wheel is used to scroll a
non-current window. This is because the |WinScrolled| event only corresponds
to the current window. The scrollbars can be refreshed with
|:ScrollViewRefresh|, scrolling, or by changing the current window.
- Workaround: Remap the problematic key sequences accordingly. >
nmap <silent> <scrollwheelup> <scrollwheelup><plug>(ScrollViewRefresh)
nmap <silent> <scrollwheeldown> <scrollwheeldown><plug>(ScrollViewRefresh)
nmap <scrollwheelup> <scrollwheelup><plug>(ScrollViewRefresh)
nmap <scrollwheeldown> <scrollwheeldown><plug>(ScrollViewRefresh)
* Scrollbars become out-of-sync after fold commands when using a
|scrollview-mode| that accounts for folds. Because there are no |autocmd-events|
for folding, the plugin is unable to refresh the scrollbars.
- Workaround: Remap the problematic fold command key sequences accordingly,
depending on the fold commands you use. >
nmap <silent> zo zo<plug>(ScrollViewRefresh)
nmap <silent> zc zc<plug>(ScrollViewRefresh)
nmap zo zo<plug>(ScrollViewRefresh)
nmap zc zc<plug>(ScrollViewRefresh)
Error Message Issues ~
*scrollview-error-message-issues*
Expand Down
9 changes: 5 additions & 4 deletions plugin/scrollview.vim
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ endif
" of <plug> mappings requires recursive map commands, this prevents mappings
" that both call <plug> functions and have the left-hand-side key sequences
" repeated not at the beginning of the right-hand-side (see :help
" recursive_mapping for details).
noremap <plug>(ScrollViewDisable) <cmd>ScrollViewDisable<cr>
noremap <plug>(ScrollViewEnable) <cmd>ScrollViewEnable<cr>
noremap <plug>(ScrollViewRefresh) <cmd>ScrollViewRefresh<cr>
" recursive_mapping for details). Experimentation suggests <silent> is not
" necessary for <cmd> mappings, but it's added to make it explicit.
noremap <silent> <plug>(ScrollViewDisable) <cmd>ScrollViewDisable<cr>
noremap <silent> <plug>(ScrollViewEnable) <cmd>ScrollViewEnable<cr>
noremap <silent> <plug>(ScrollViewRefresh) <cmd>ScrollViewRefresh<cr>
" *************************************************
" * Core
Expand Down

0 comments on commit f729b1d

Please sign in to comment.