Just like doc:find-view
Signed-off-by: NeilBrown <neil@brown.name>
if (strcmp(ci->key, "doc:add-view") == 0) {
if (!ci->comm2)
return -1;
- ci->extra = do_doc_add_view(dd->doc, ci->comm2, ci->extra);
- return 1;
+ return 1 + do_doc_add_view(dd->doc, ci->comm2, ci->extra);
}
if (strcmp(ci->key, "doc:del-view") == 0) {
static inline int doc_add_view(struct pane *p, struct command *c, int size)
{
struct cmd_info ci = {0};
+ int ret;
ci.focus = p;
ci.key = "doc:add-view";
ci.comm2 = c;
ci.extra = size;
- if (key_handle_focus(&ci) == 0)
+ ret = key_handle_focus(&ci);
+ if (ret <= 0)
return -1;
- return ci.extra;
+ return ret - 1;
}
static inline void doc_del_view(struct pane *p, struct command *c)