]> git.neil.brown.name Git - edlib.git/commitdiff
menu: disable shift as well as wrap.
authorNeilBrown <neil@brown.name>
Sun, 3 Sep 2023 09:34:20 +0000 (19:34 +1000)
committerNeilBrown <neil@brown.name>
Mon, 4 Sep 2023 23:07:53 +0000 (09:07 +1000)
As 'popup' sets render-wrap, we must set to later in the stack for it to
take effect.  We need text not to shift at all, or we get problems with
cursor at the end of right-aligned text.

Signed-off-by: NeilBrown <neil@brown.name>
lib-menu.c

index a082c197d769872ba146a6acaeb32059dc056b72..98a1adfc6478f3d4f0bd6d0379def24264e62d45 100644 (file)
@@ -122,7 +122,6 @@ DEF_CMD(menu_attach)
                return Efail;
        call("doc:set:autoclose", docp, 1);
        attr_set_str(&docp->attrs, "render-simple", "format");
-       attr_set_int(&docp->attrs, "render-wrap", 0);
        attr_set_str(&docp->attrs, "heading", "");
        if (ci->num & 1)
                /* show the 'action' - presumably a key name */
@@ -144,8 +143,10 @@ DEF_CMD(menu_attach)
                return Efail;
        }
        p2 = pane_register(p2, 0, &menu_handle.c);
+       /* Don't allow any shift - we size the menu to fit */
        if (!p2)
                return Efail;
+       attr_set_int(&p2->attrs, "render-wrap", 0);
        call("Mouse-grab", p2);
        return comm_call(ci->comm2, "cb:attach", p2);
 }