about summary refs log tree commit diff
path: root/Src/Zle/zle_params.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-09-10 18:03:33 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-09-10 18:03:33 +0000
commitb12c16850521328a396bb62c3b07558f9308c621 (patch)
treee94fb1580aa2dca85c07f91e1f01afa75ce5f521 /Src/Zle/zle_params.c
parent6f607e1098b9be314d551ea475ca45c368953a03 (diff)
downloadzsh-b12c16850521328a396bb62c3b07558f9308c621.tar.gz
zsh-b12c16850521328a396bb62c3b07558f9308c621.tar.xz
zsh-b12c16850521328a396bb62c3b07558f9308c621.zip
20348: rejig WIDGETSTYLE and add WIDGETFUNC
Diffstat (limited to 'Src/Zle/zle_params.c')
-rw-r--r--Src/Zle/zle_params.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c
index efbad97f5..d5fa6dd26 100644
--- a/Src/Zle/zle_params.c
+++ b/Src/Zle/zle_params.c
@@ -93,6 +93,8 @@ static struct zleparam {
 	zleunsetfn, NULL },
     { "WIDGET", PM_SCALAR | PM_READONLY, NULL, FN(get_widget),
         zleunsetfn, NULL },
+    { "WIDGETFUNC", PM_SCALAR | PM_READONLY, NULL, FN(get_widgetfunc),
+        zleunsetfn, NULL },
     { "WIDGETSTYLE", PM_SCALAR | PM_READONLY, NULL, FN(get_widgetstyle),
 	zleunsetfn, NULL },
     { NULL, 0, NULL, NULL, NULL, NULL }
@@ -282,6 +284,21 @@ get_widget(UNUSED(Param pm))
 
 /**/
 static char *
+get_widgetfunc(UNUSED(Param pm))
+{
+    Widget widget = bindk->widget;
+    int flags = widget->flags;
+
+    if (flags & WIDGET_INT)
+	return ".internal";	/* Don't see how this can ever be returned... */
+    else if (flags & WIDGET_NCOMP)
+	return widget->u.comp.func;
+    else
+	return widget->u.fnnam;
+}
+
+/**/
+static char *
 get_widgetstyle(UNUSED(Param pm))
 {
     Widget widget = bindk->widget;
@@ -292,7 +309,7 @@ get_widgetstyle(UNUSED(Param pm))
     else if (flags & WIDGET_NCOMP)
 	return widget->u.comp.wid;
     else
-	return widget->u.fnnam;
+	return "";
 }
 
 /**/