Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeat like key pressed to repeat #8

Open
cdlm opened this issue Mar 16, 2014 · 5 comments
Open

Repeat like key pressed to repeat #8

cdlm opened this issue Mar 16, 2014 · 5 comments

Comments

@cdlm
Copy link

cdlm commented Mar 16, 2014

If you jump to a character x, using fx, then both f and t will jump to the next occurrence of x, but t does the same (i.e. it just repeats the initial fx jump).

IMHO, f should do a further jump in a f-ish way, and t in a t-ish way, independently of whether the initial jump was fx or tx. For instance, fxt should jump to before the second occurrence of x. Of course, likewise for any permutation of f, F, t, T.

@notEvil
Copy link

notEvil commented Jun 4, 2014

I must agree. And its easily implemented. Here is a working patch for ./autoload/clever_f.vim:

--- clever_f.vim        2014-06-04 13:20:06.562382100 +0200
+++ clever_f.vim.new    2014-06-04 13:18:24.807382100 +0200
@@ -46,6 +46,7 @@
     endif
     endtry
 else
+        let s:previous_map[mode] = a:map " hack
     " when repeated
     let back = a:map =~# '\u'
 endif

@cdlm
Copy link
Author

cdlm commented Jun 4, 2014

Hi, I don't see the same patch on github as in the mail I got as a notification of your comment… did you edit it ? Which version is correct ?

@notEvil
Copy link

notEvil commented Jun 4, 2014

yeah, sry about that. Short after I recognized that the s:previous_map variable already existed. So the shorter version you see here will do. It just disables the memory by overwriting it.
The clean solution would be to remove the memory entirely, however this should be up to @rhysd

@sunaku
Copy link

sunaku commented Mar 31, 2015

@cdlm the patch is here: notEvil/clever-f.vim@15af064 🎌

@Arnie97
Copy link

Arnie97 commented Apr 30, 2020

@rhysd Would you like to merge this patch back to the mainline? We could also add a new flag to make this behavior optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants