if (!style)
style = "D3";
+
if (strchr(style, 'D')) {
- struct cmd_info ci2 = {0};
int x = 0, y = 0;
pane_to_root(ci->focus, &x, &y, &z, NULL, NULL);
ci2.key = "global-key-root";
- ci2.focus = ci->focus;
- if (!key_handle_focus(&ci2))
- return 0;
- root = ci2.focus;
- } else {
- p = ci->focus;
- while (p && !p->point)
- p = p->parent;
- if (!p || !p->parent)
- return 0;
- root = p->parent;
- }
+ } else
+ ci2.key = "ThisPane";
+ ci2.focus = ci->focus;
+
+ if (!key_handle_focus(&ci2))
+ return 0;
+ root = ci2.focus;
ppi->target = ci->focus;
ppi->popup = pane_register(root, z, &popup_handle, ppi, NULL);
p = doc_attach_view(ppi->popup, dp, NULL);
}
pane_focus(p);
+ memset(&ci2, 0, sizeof(ci2));
ci2.key = "local-set-key";
ci2.focus = p;
ci2.str = "popup:quote";
return 1;
}
+DEF_CMD(tile_this)
+{
+ ci->focus = ci->home;
+ return 1;
+}
+
void edlib_init(struct editor *ed)
{
tile_map = key_alloc();
key_add(tile_map, "WindowOP", &tile_command);
key_add(tile_map, "OtherPane", &tile_other);
+ key_add(tile_map, "ThisPane", &tile_this);
key_add(ed->commands, "attach-tile", &tile_attach);
}