You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when I do giiw (go insert in word) and insert something, when I repeat it doesn't repeat the whole giiw, it just inserts at the current cursor position:
this is an exa<cursor>mple
giiw and type new_
this is an new_<cursor>example
ge then .
this is anew_n new_<cursor>example
instead of
this is new_an new_<cursor>example
Any idea on how to approach this? I think an insert and append operator would be quite useful (specially combined with vim-targets)
The text was updated successfully, but these errors were encountered:
I think what is happening is the undo operation is created after leaving insert mode, which means the call to repeat#set() is superseded. You could maaaaaaybe leverage InsertLeave to pull this off, or some other clever trick, but I think you're on your own to figure that out.
If possible, could you clarify me a little bit how it works? Because there is only one call repeat#set(), which from what I've seen needs to be placed just after the operation is finished? But how does it know when it started? How does it know to what text object it applies?
I don't know that it can be done, but I would start by setting a private variable to b:changedtick in your function (and another variable for the text object etc) and then check that it's 1 higher in InsertLeave.
I'm trying to make the following operators repeatable:
https://github.com/mwgkgk/vim-operator-insert
I tried adding:
But when I do
giiw
(go insert in word) and insert something, when I repeat it doesn't repeat the wholegiiw
, it just inserts at the current cursor position:giiw
and typenew_
ge
then.
instead of
Any idea on how to approach this? I think an insert and append operator would be quite useful (specially combined with vim-targets)
The text was updated successfully, but these errors were encountered: