lsp-bridge icon indicating copy to clipboard operation
lsp-bridge copied to clipboard

Inconsistent behaviour between the completion and the evil-repeat command.

Open CabalCrow opened this issue 2 years ago • 2 comments

After I've used the acm-complete command in insert mode, it doen not always insert the same text when I try to insert it again via the evil-repeat command. This behaviour seems to happen more often if I've scrolled through the completion candidates via acm-select-next. It is also context aware so if I apend/change some text in position A with the acm-complete, and then I try to use the evil-repeat command in position B I will have a different result.

I suspect this is because evil-repeat is repeating the acm-complete command again, rather than just inputting the text that was selected the last time via the acm-complete command. This also slows down the evil-repeat command when used many times in a row as the acm calls a popup buffer everytime.

The behaviour I expected was for evil-repeat to always input the same text when acm-complete was used.

Here some examples: In elisp mode:

some-
same-

I have this text, if I apend "some-" with "buffer" by using acm-complete, and then I try to apend the "same-" with "buffer" by using evil-repeat afterwards, I instead get "some-buffer" on both lines. This is the most consistent way to reproduce this behaviour. There are other ways to achive this behaviour - but they tend to be inconsisten. They happen often, but are hard to reproduce consistently.

CabalCrow avatar Dec 23 '22 10:12 CabalCrow

I don't use evil, can't help you

manateelazycat avatar Dec 23 '22 11:12 manateelazycat

Looking at evil-integration.el, I think this should do?

(mapc #'evil-declare-change-repeat
      '(acm-complete
        acm-insert-common))
(mapc #'evil-declare-ignore-repeat
      '(acm-doc-scroll-down
        acm-doc-scroll-up
        acm-doc-toggle
        acm-filter
        acm-hide
        acm-select-first
        acm-select-last
        acm-select-next
        acm-select-prev))

I still get "lingering" completion popup after exiting insert-mode, though very rarely. Not sure if this is due to evil-mode or just childframes being a bit flaky on macos in general. More testing needed ...

all9n avatar Dec 24 '22 12:12 all9n