evil icon indicating copy to clipboard operation
evil copied to clipboard

repeat-last after completion produces unexpected results

Open mihaicristiantanase opened this issue 2 years ago • 2 comments

I found an issue with evil-repeat in combination with evil-paste-pop-next. With the following text:

line1: setDateBegin
line2: setDateToChange(getSomeOtherStart)
  1. place the point at ToChange
  2. replace it with Begin via cw C-p (ie, change word and complete current word)
  3. place the point at Start
  4. replace it with . (ie, repeat last)

The result is

line1: setDateBegin
line2: setDateBegin(getSosetDateBegin)

which is different from the expected result:

line1: setDateBegin
line2: setDateBegin(getSomeOtherBegin)

mihaicristiantanase avatar Aug 18 '22 11:08 mihaicristiantanase

@mihaicristiantanase - very interesting - thanks for the bug report. Technically when you run evil-complete-previous (evil-paste-pop-next has nothing to do with this, I think you did C-h k from normal state when you meant to do it from insert state?) it changes the whole word to match, even though the bit up until the cursor is identical (so it doesn't appear to change) but this change is stored by evil-repeat and then inserted relative to the cursor (before and after it, in this case). I can't promise I'll have time to take a look soon, but I'll leave this note here to remind myself (or whoever else looks into it) what the cause is.

tomdl89 avatar Aug 18 '22 20:08 tomdl89

Thanks for the clarification. You are right about evil-paste-pop-next - that explains why I could not find anything related to completion there...

mihaicristiantanase avatar Aug 19 '22 06:08 mihaicristiantanase