Skip to content

Commit b43808e

Browse files
committed
fix count/range propagation through fallback menu
1 parent ad19caf commit b43808e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

plugin/shortcut.vim

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ function! s:shortcut_menu_item_action(choice) abort
3535
"
3636
call feedkeys("\<esc>", 'n')
3737

38-
" restore visual selection or numbered repetition
39-
if s:is_from_visual
40-
normal! gv
41-
elseif v:count
42-
call feedkeys(v:count, 'n')
43-
endif
44-
4538
" restore cursor to original position before menu
4639
call winrestview({
4740
\ 'lnum': s:cursor_position.lnum,
4841
\ 'col': s:cursor_position.curswant
4942
\ })
5043

44+
" restore visual selection or numbered repetition
45+
if v:count
46+
call feedkeys(v:count, 'n')
47+
elseif s:is_from_visual
48+
call feedkeys('gv', 'n')
49+
endif
50+
5151
" trigger shortcut by typing keys on user's behalf
5252
let shortcut = matchstr(a:choice, '^\S\+')
5353
let keystrokes = ShortcutKeystrokes(shortcut)

0 commit comments

Comments
 (0)