From: NeilBrown Date: Wed, 2 Dec 2015 02:11:24 +0000 (+1100) Subject: Disable recursive popups except by permission. X-Git-Tag: lca2016~141 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=8c0c2c42e710c10df8657281400de927a667b1b2;p=edlib.git Disable recursive popups except by permission. So trying to search in a file-file buffer now doesn't work. This might need work for searching in a completion list?? Signed-off-by: NeilBrown --- diff --git a/lib-popup.c b/lib-popup.c index 8b04d8fd..aa8d9724 100644 --- a/lib-popup.c +++ b/lib-popup.c @@ -125,6 +125,7 @@ DEF_CMD(popup_attach) * TBLR - 0, 1, or 2 can be given for center, side, or corner * M - multi line, else one line * 1234 - how many quarters of width to use.(default 2); + * r - allow recursive popup */ struct pane *root, *p; struct popup_info *ppi = malloc(sizeof(*ppi)); @@ -137,6 +138,11 @@ DEF_CMD(popup_attach) if (!style) style = "D3"; + if (!strchr(style, 'r') && + pane_attr_get(ci->focus, "Popup") != NULL) + /* No recusive popups without permission */ + return 0; + if (strchr(style, 'D')) { int x = 0, y = 0; pane_to_root(ci->focus, &x, &y, &z, NULL, NULL); @@ -156,6 +162,7 @@ DEF_CMD(popup_attach) border[j++] = "TLBR"[i]; } border[j] = 0; + attr_set_str(&ppi->popup->attrs, "Popup", "true", -1); attr_set_str(&ppi->popup->attrs, "borders", border, -1); attr_set_str(&ppi->popup->attrs, "render-wrap", "no", -1); diff --git a/mode-emacs.c b/mode-emacs.c index bdf5d543..99d27c40 100644 --- a/mode-emacs.c +++ b/mode-emacs.c @@ -347,7 +347,9 @@ DEF_CMD(emacs_file_complete) } docp = doc_open(ed, fd, d); close(fd); - pop = pane_attach(ci->focus, "popup", docp, "DM1"); + pop = pane_attach(ci->focus, "popup", docp, "DM1r"); + if (!pop) + return -1; par = pane_final_child(pop); attr_set_str(&par->attrs, "line-format", "%+name%suffix", -1);