summary refs log tree commit diff
path: root/Src/Zle/zle_params.c
diff options
context:
space:
mode:
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 "";
 }
 
 /**/