Open zhyzky opened 1 year ago
This issue not happens on windows. the config file:
nnoremap
nmap
let g:which_key_map['a']={ \ 'name': '+Mark', \ 'a': 'Mark current', \ 'r': 'Mark regex', \ 'd': 'Mark remove', \ 'c': 'Clear all mark', \ 's': 'Next mark', \ 'S': 'Prev mark', \ 'n': 'CurrentMark Next', \ 'N': 'CurrentMark Prev', \ }
After some investigation, the issue seems related to: autoload/which_key.vim, line 403, where a line number add before the Cmd. Not Sure What's going on with the line range here
I confirm the same issue, it's impossible to use a selected range.
I did not use VWK on the selection before but I would like to sort a spaced list inside a range on the same line.
vnoremap <F2> d:execute 'normal a' . join(uniq(sort(split(getreg('"')))), ' ')<CR>
'<,'>
somewhere?let g:which_key_map_visual.n.s = 'sort+uniq(spacedWords)'
vnoremap <Leader>ns d:execute 'normal a' . join(uniq(sort(split(getreg('"')))), ' ')<CR>
I confirm the same issue, it's impossible to use a selected range.
I did not use VWK on the selection before but I would like to sort a spaced list inside a range on the same line.
- Without VWK the command affect the current selection in visual mode and it works:
vnoremap <F2> d:execute 'normal a' . join(uniq(sort(split(getreg('"')))), ' ')<CR>
- But with VWK, pressing the leader key exits the selection and affect only the cursor location. It would work if it affected the last selection, but I don't know how. Should I put
'<,'>
somewhere?let g:which_key_map_visual.n.s = 'sort+uniq(spacedWords)' vnoremap <Leader>ns d:execute 'normal a' . join(uniq(sort(split(getreg('"')))), ' ')<CR>
Maybe you can just comment out the line " let Cmd = line('v').','.line('.').Cmd " Didn't get the purpose of line range here, there might be some side effect, though I havn't met yet.
Warning: if you don't fill this issue template and provide the reproducible steps the issue could be closed directly.
Environment (please complete the following information):
OS: ubuntu 22.04
Vim version: 8.2
vim-which-key version: ea87707
Have you reproduced with a minimal vimrc: No
Describe the bug When in visual mode, after which-key hint pops, and just before the actual command executed. You may notice that the cursor jumps at the beginning of line.
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.