summaryrefslogtreecommitdiff
path: root/Src/Zle/zle_thingy.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:18:04 +0200
committerAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:18:04 +0200
commit31bcc5c263aea983e967426e2b94269e7605dcd4 (patch)
tree7b48ad9d7799afe09b7d7d8adc980bd5db935bdf /Src/Zle/zle_thingy.c
parent5086b5356abcef8849dc8a09902b7c55f01db3c0 (diff)
parentb09f4483416c54c1782824633dfabaf2ec0265b6 (diff)
downloadzsh-31bcc5c263aea983e967426e2b94269e7605dcd4.tar.gz
zsh-31bcc5c263aea983e967426e2b94269e7605dcd4.zip
Update upstream source from tag 'upstream/5.8.1.2-test'
Update to upstream version '5.8.1.2-test' with Debian dir b380d582bf51cd93149e4dea28fffa1ad85db4f5
Diffstat (limited to 'Src/Zle/zle_thingy.c')
-rw-r--r--Src/Zle/zle_thingy.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c
index ce61db27b..cd3f2c356 100644
--- a/Src/Zle/zle_thingy.c
+++ b/Src/Zle/zle_thingy.c
@@ -678,6 +678,7 @@ bin_zle_flags(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
else if (!strcmp(*flag, "keepsuffix"))
w->flags |= ZLE_KEEPSUFFIX;
*/
+ /* If you add magic strings here, be consistent with bin_zle_call() */
else if (!strcmp(*flag, "vichange")) {
if (invicmdmode()) {
startvichange(-1);
@@ -703,7 +704,7 @@ bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
{
Thingy t;
struct modifier modsave = zmod;
- int ret, saveflag = 0, setbindk = 0, setlbindk, remetafy;
+ int ret, saveflag = 0, setbindk = 0, setlbindk = 0, remetafy;
char *wname = *args++, *keymap_restore = NULL, *keymap_tmp;
if (!wname)
@@ -727,12 +728,26 @@ bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
while (*args && **args == '-') {
char skip_this_arg[2] = "x";
char *num;
+ char *flag;
if (!args[0][1] || args[0][1] == '-') {
args++;
break;
}
while (*++(*args)) {
switch (**args) {
+ case 'f':
+ flag = args[0][1] ? args[0]+1 : args[1];
+ if (flag == NULL || strcmp(flag, "nolast")) {
+ zwarnnam(name, "%s", "'nolast' expected after -f");
+ if (remetafy)
+ metafy_line();
+ return 1;
+ }
+ if (!args[0][1])
+ *++args = skip_this_arg;
+ /* If you add magic strings here, be consistent with bin_zle_flags() */
+ setlbindk = 1;
+ break;
case 'n':
num = args[0][1] ? args[0]+1 : args[1];
if (!num) {
@@ -787,7 +802,7 @@ bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
* a vi range to detect a repeated key */
setbindk = setbindk ||
(t->widget && (t->widget->flags & (WIDGET_INT | ZLE_VIOPER)) == WIDGET_INT);
- setlbindk = t->widget && (t->widget->flags & ZLE_NOLAST) == ZLE_NOLAST;
+ setlbindk |= t->widget && (t->widget->flags & ZLE_NOLAST) == ZLE_NOLAST;
ret = execzlefunc(t, args, setbindk, setlbindk);
unrefthingy(t);
if (saveflag)