diff options
author | Oliver Kiddle <opk@zsh.org> | 2016-11-20 23:54:45 +0100 |
---|---|---|
committer | Oliver Kiddle <opk@zsh.org> | 2016-11-20 23:59:48 +0100 |
commit | cb5f100bd38a3b21739897fb4236db0700b39477 (patch) | |
tree | 8ad0e44d32b2bf7e7c11e05f9789b7efef2e9a3f /Src/Zle/zle_thingy.c | |
parent | fe67ccacf15ee92864f7485fd9e54c3dd1f5d1e3 (diff) | |
download | zsh-cb5f100bd38a3b21739897fb4236db0700b39477.tar.gz zsh-cb5f100bd38a3b21739897fb4236db0700b39477.tar.xz zsh-cb5f100bd38a3b21739897fb4236db0700b39477.zip |
39986, 39989: improve handling of vi-repeat-change
Save previous vi change and throw away a new change that fails. Add zle -f vichange to allow shell widget to be a single change. Fix repeat of command where numeric arguments were multiplied.
Diffstat (limited to 'Src/Zle/zle_thingy.c')
-rw-r--r-- | Src/Zle/zle_thingy.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c index 2d4674785..c7092854a 100644 --- a/Src/Zle/zle_thingy.c +++ b/Src/Zle/zle_thingy.c @@ -678,7 +678,16 @@ bin_zle_flags(char *name, char **args, UNUSED(Options ops), UNUSED(char func)) else if (!strcmp(*flag, "keepsuffix")) w->flags |= ZLE_KEEPSUFFIX; */ - else { + else if (!strcmp(*flag, "vichange")) { + if (invicmdmode()) { + startvichange(-1); + if (zmod.flags & (MOD_MULT|MOD_TMULT)) { + Param pm = (Param) paramtab->getnode(paramtab, "NUMERIC"); + if (pm && pm->node.flags & PM_SPECIAL) + pm->node.flags &= ~PM_UNSET; + } + } + } else { zwarnnam(name, "invalid flag `%s' given to zle -f", *flag); ret = 1; } |