evil: work on support for ]p, [p (adjust indent on paste)

Frank Fischer frank-fischer at shadow-soft.de
Wed Jul 2 20:46:03 CEST 2014


Am 30.06.2014 04:04, schrieb Gordon Gustafson:
> You may already know this, but you're going to want to define new
> commands for [p and ]p using the macro evil-define-command. I haven't
> though it all the way through yet, but you'll probably call
> evil-paste-before or evil-paste-after at the beginning and then
> reindent what was pasted. This should ensure that the commands are a
> single undo step. I'm not sure about evil-paste-pop, but if you post
> code for the commands I described I can see if you need to do anything
> funky to get it working. :)

That's more or less what I would do. However, `evil-paste-pop` won't
work because it relies on the previous command being `evil-paste-before`
or `evil-paste-after`. So at least you would have to modify the code of
`evil-paste-pop` accordingly. (should be easy--it may be even better to
introduce a constant that defines the list of commands which are
paste-commands or even use a command-property like :keep-visual or
:repeat, i.e., add something like `:paste-command t` to the command
definition and check in `evil-paste-pop` for this property).

Best regards,
Frank





More information about the implementations-list mailing list