### Small
-- [ ] detect and limit recursion.
+- [X] detect and limit recursion.
- [ ] message-line: use lib-renderline for the one line, so we have
markup support.
- [ ] history: Make it possible to search through history. Maybe Alt-p only shows
Core features
-------------
+- [ ] LOG_BT() doesn't see TYPE_pane and TYPE_comm calls.
- [ ] give every pane a link to root/editor main and use that
instead of statics. Then maybe times_up() can use pane_too_long()
- [ ] mark DEF_CMD structs as const
Efalse probably becomes 0.
- [ ] send warning message when recursive notification is prohibited.
editor:notify:Message:broadcast
-- [ ] detect and limit recursion.
+- [X] detect and limit recursion.
Each call creates a frame, and each pane has a link to recent frame
If a call happens on a frame with a link, we check that the same
'key' isn't already active.
const struct cmd_info *ci safe;
struct backtrace *prev;
} *backtrace;
+static int backtrace_depth;
static char *mark_info(struct mark *m)
{
struct backtrace bt;
int ret;
+ if (edlib_timing == 1)
+ return Efail;
+ if (backtrace_depth > 100) {
+ backtrace_depth = 0;
+ LOG("Recursion limit of 100 reached");
+ LOG_BT();
+ backtrace_depth = 100;
+ edlib_timing = 1;
+ return Efail;
+ }
bt.comm = comm;
bt.ci = ci;
bt.prev = backtrace;
backtrace = &bt;
+ backtrace_depth += 1;
ret = comm->func(ci);
backtrace = bt.prev;
+ backtrace_depth -= 1;
return ret;
}