kana / vim-arpeggio

Vim plugin: Mappings for simultaneously pressed keys
http://www.vim.org/scripts/script.php?script_id=2425
269 stars 18 forks source link

undo joining #34

Closed nilsbecker closed 1 year ago

nilsbecker commented 1 year ago

i'm trying to undo an arpeggio map in one step. normally this works, i.e. Arpeggio imap jk asdf will undo in one step. however, my map uses the expression register to call a function:

Arpeggio inoremap () ()<c-r>=UltiSnips#Expand()<cr>

this is useful for me as an auto-parentheses function in conjunction with a snippet that expands () in UltiSnips. See also this stackoverflow question.

when i undo after this mapping, the initial () is still present; i have to undo again to make it disappear. how can i undo the full mapping in one go?

kana commented 1 year ago

At least, arpeggio is not relevant to the problem. Because it can be reproduced without arpeggio. For example, changing the key mapping to expand the snippet as follows:

inoremap () ()<c-r>=UltiSnips#ExpandSnippet()<cr>

still needs undo twice.

nilsbecker commented 1 year ago

ah thanks, that's good to know. i guess we can close this then?

nilsbecker commented 1 year ago

i'll update the SO question as well