AndrewRadev/switch.vim

"." repeats always forward, even if the last used command was "SwitchReverse"

KnoP-01 opened this issue · 2 comments

Hello,

I'd like to suggest the following change:

function! s:SwitchReverse()
  silent call switch#Switch({'reverse': 1})
  silent! call repeat#set(":Switch\<cr>")
endfunction

to

function! s:SwitchReverse()
  silent call switch#Switch({'reverse': 1})
  silent! call repeat#set(":SwitchReverse\<cr>") " <- Change here
endfunction

I can create a pull request if favored.

That's a good catch, thanks -- I think your suggestion is definitely the correct way it should go. I've made the change and used the chance to add some tests for repeating. Could you confirm that it works as you expect now?

works as expected. Thank you!