From 1f8702bdee0d19e9354ce26735e5d87865b55dc0 Mon Sep 17 00:00:00 2001 From: Jaehwang Jung Date: Sat, 17 Feb 2024 00:06:02 +0900 Subject: [PATCH] fix dot-repeat for g@ #308 When repeating `g@` operator, `sneak#wrap()` uses information stored in `s:st.opfunc_st` instead of taking additional input. --- plugin/sneak.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/sneak.vim b/plugin/sneak.vim index ad1be98..e4188ec 100644 --- a/plugin/sneak.vim +++ b/plugin/sneak.vim @@ -252,7 +252,11 @@ func! sneak#to(op, input, inputlen, count, register, repeatmotion, reverse, incl if is_op && a:op !=# 'y' let change = a:op !=? "c" ? "" : "\.\" - let seq = a:op."\SneakRepeat".sneak#util#strlen(a:input).a:reverse.a:inclusive.(2*!empty(target)).a:input.target.change + let args = sneak#util#strlen(a:input) . a:reverse . a:inclusive . (2*!empty(target)) + if a:op !=# 'g@' + let args .= a:input . target . change + endif + let seq = a:op . "\SneakRepeat" . args silent! call repeat#setreg(seq, a:register) silent! call repeat#set(seq, a:count)