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 command is broken with execute-keys from insert mode #3600

Closed
alexherbo2 opened this issue Jul 14, 2020 · 1 comment · Fixed by #5104
Closed

Repeat command is broken with execute-keys from insert mode #3600

alexherbo2 opened this issue Jul 14, 2020 · 1 comment · Fixed by #5104
Labels

Comments

@alexherbo2
Copy link
Contributor

How to reproduce

  1. Add the following setup:
map global insert <space> '<a-;>: insert-space<ret>'

define-command insert-space %{
  execute-keys <space>
}
  1. Then type:
i<space><esc>.

Affects auto-pairs.kak.

@topisani
Copy link
Contributor

To simplify it, it also happens without calling a command, and without using a mapping>

  • execute i<a-;>:exec t<ret><esc>: one t is inserted
  • execute .: tt is inserted
  • execute .: ttt is inserted

For every repeat, it increases the number of ts in the repeat list by one

topisani added a commit to topisani/kakoune that referenced this issue Feb 24, 2024
Insert repeat will now only record non-synthesized keys, and when played back
execute mappings as well. Constructing some tests, and with the specific goal
of fixing alexherbo2/auto-pairs.kak#38, this appeared to
be the best approach. Other options could be evaluating the maps only when recording,
but this gave other issues (see tests/normal/repeat-insert/repeat-insert-mapped)

At this point, repeat-insert may be essentially just a hardcoded macro, at least I
haven't identified the difference. If this really is the case, it may make sense to
give it a dedicated register, and implement it as a macro.

Fixes mawww#3600
@mawww mawww closed this as completed in dbe8528 Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants