* Provide a pane that is instantiated between the root and any window
* stack, to provide common functionality. These includes:
*
+ * - setting per-window attributes
* - registering and forwarding per-window notifications
* - Being an intermediary for per-window selections.
*
ci->num2, ci->mark2, ci->str2, ci->comm2);
}
+DEF_CMD(window_set)
+{
+ const char *val = ksuffix(ci, "window:set:");
+
+ if (!*val)
+ val = ci->str2;
+ if (!val)
+ return Enoarg;
+
+ if (ci->str)
+ attr_set_str(&ci->home->attrs, val, ci->str);
+
+ return 1;
+}
+
DEF_CMD(selection_claim)
{
struct window_data *wd = ci->home->data;
key_add(window_map, "Display:close", &window_close);
+ key_add_prefix(window_map, "window:set:", &window_set);
+
key_add(window_map, "selection:claim", &selection_claim);
key_add(window_map, "selection:commit", &selection_commit);
key_add(window_map, "selection:discard", &selection_discard);
p = call_ret(pane, "attach-display-ncurses", ed,
0, NULL, "-", 0, NULL, TERM);
+ if (p)
+ p = call_ret(pane, "editor:activate-display", p);
if (p) {
char *e;
e = getenv("SSH_CONNECTION");
if (e && *e)
- attr_set_str(&p->attrs, "REMOTE_SESSION", "yes");
+ call("window:set:REMOTE_SESSION", p,
+ 0, NULL, "yes");
- attr_set_str(&p->attrs, "DISPLAY", getenv("DISPLAY"));
- attr_set_str(&p->attrs, "XAUTHORITY", getenv("XAUTHORITY"));
- p = call_ret(pane, "editor:activate-display", p);
+ call("window:set:DISPLAY", p,
+ 0, NULL, getenv("DISPLAY"));
+ call("window:set:XAUTHORITY", p,
+ 0, NULL, getenv("XAUTHORITY"));
}
if (p)
p = home_call_ret(pane, doc, "doc:attach-view",
p = edlib.editor
p = p.call("attach-display-ncurses", path, env['TERM'],
ret='pane')
+ self.term = p.call("editor:activate-display", ret='pane')
for v in env:
- p[v] = env[v]
+ self.term.call("window:set:", env[v], v)
self.disp = p
- self.term = self.disp.call("editor:activate-display", ret='pane')
self.add_notify(self.disp, "Notify:Close")
self.sock.send(b"OK")
return 1