hitting a python error - there will be no active view so the
screen will be meaningless. I need to properly abort and
auto-choose a new pane.
-- [ ] LOG_BT() doesn't see TYPE_pane and TYPE_comm calls.
+- [X] LOG_BT() doesn't see TYPE_pane and TYPE_comm calls.
- [ ] LOG should take a pane arg, and not use any static vars.
- [ ] reduce size of $(nm O/*.o | grep ' b ' | grep -v '_map$')
- [X] give every pane a link to root/editor main and use that
LOG("End Backtrace");
}
-static int do_comm_call(struct command *comm safe,
- const struct cmd_info *ci safe)
+int do_comm_call(struct command *comm safe, const struct cmd_info *ci safe)
{
struct backtrace bt;
int ret;
+ if (ci->home->damaged & DAMAGED_DEAD)
+ return Efail;
if (times_up_fast(ci->home))
return Efail;
+ if ((ci->home->damaged & DAMAGED_CLOSED) &&
+ !comm->closed_ok)
+ return Efallthrough;
+
if (backtrace_depth > 100) {
backtrace_depth = 0;
LOG("Recursion limit of 100 reached");
vci->home = p;
vci->comm = p->handle;
/* Don't add this to the call stack as it
- * should simple call the desired function and
+ * should simply call the desired function and
* that will appear on the call stack.
*/
ret = p->handle->func(ci);
pane_free(p);
}
+int do_comm_call(struct command *comm safe, const struct cmd_info *ci safe);
static inline int do_call_val(enum target_type type, struct pane *home,
struct command *comm2a,
const char *key safe, struct pane *focus safe,
ret = key_handle(&ci);
break;
case TYPE_pane:
- if (!home->handle || (home->damaged & DAMAGED_DEAD))
- return Efail;
- if (times_up_fast(focus))
- return Efail;
- if (home)
- ci.home = home;
- if ((home->damaged & DAMAGED_CLOSED) &&
- !home->handle->closed_ok)
- /* This pane cannot accept anything but
- * close_ok commands.
- */
- return Efallthrough;
- ci.comm = home->handle;
- ret = ci.comm->func(&ci);
+ ci.home = home;
+ if (home->handle)
+ ci.comm = home->handle;
+ ret = do_comm_call(ci.comm, &ci);
break;
case TYPE_comm:
- if (times_up_fast(focus))
- return Efail;
if (home)
ci.home = home;
- if (ci.home->damaged & DAMAGED_CLOSED &&
- !comm2a->closed_ok)
- return Efallthrough;
ci.comm = comm2a;
ci.comm2 = comm2b;
- ret = ci.comm->func(&ci);
+ ret = do_comm_call(ci.comm, &ci);
break;
}
return ret;