From: NeilBrown Date: Sun, 3 Sep 2023 09:34:20 +0000 (+1000) Subject: menu: disable shift as well as wrap. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=6901119378172148787c4db070357439d7474916;p=edlib.git menu: disable shift as well as wrap. 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 --- diff --git a/lib-menu.c b/lib-menu.c index a082c197..98a1adfc 100644 --- a/lib-menu.c +++ b/lib-menu.c @@ -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); }