### Trivial
+- [ ] Unify edlib_timing and pane_too_long ??
- [X] If an email part doesn't end with newline, last character is swallowed.
- [X] What is rule for doc:content? Does the mark move and get passed
down, or is it copied and left unchanged?
### Medium
+- [ ] add event:on-idle with 3 priority levels
- [X] Always do word-count async.
- [ ] lib-url
- [ ] lib-mergeview improvements
Core features
-------------
+- [ ] add event:on-idle with 3 priority levels
+ 2 - fast cleanup that must be run immediately
+ 1 - slower general response to recent command: typically
+ pane_refresh
+ 0 - do one of these before checking of other events
+ Use 2 for freeing panes and marks and other memory
+ Use 1 for pane_refresh
+ Use 0 for splitting up background tasks like spell and linecount
+ simplify main loop in edlib.c to: call("event:run", ed)
- [ ] teach input to allow a repeat command to be registered so that e.g.
search/replace and do a bit of work, then ask to be called again.
input can cancel this on suitable input.
static struct map *linecount_map;
DEF_LOOKUP_CMD(handle_count_lines, linecount_map);
-static const int batch_marks = 6;
+static const int batch_marks = 1;
+static const int batch_timer = 20;
static bool testing = False;
struct count_info {
{
int lines, words, chars, l, w, c;
struct mark *m, *m2;
+ char *disable;
if (testing)
sync = True;
+ disable = pane_attr_get(p, "linecount-disable");
+ if (disable && strcmp(disable, "yes") == 0) {
+ if (end) {
+ attr_set_str(&end->attrs, "line", "??");
+ attr_set_str(&end->attrs, "word", "??");
+ attr_set_str(&end->attrs, "char", "??");
+ }
+ attr_set_str(&p->attrs, "lines", "-");
+ attr_set_str(&p->attrs, "words", "-");
+ attr_set_str(&p->attrs, "chars", "-");
+ return;
+ }
+
if (!end && attr_find(p->attrs, "lines"))
/* nothing to do */
return;
call("doc:set-ref", p, 1, m);
do_count(p, owner, m, vmark_next(m), &l, &w, &c, sync ? -1 : batch_marks);
if (!sync) {
- call_comm("event:timer", p, &linecount_restart, 10, end);
+ call_comm("event:timer", p, &linecount_restart, batch_timer, end);
return;
}
}
/* need to update this one */
do_count(p, owner, m, vmark_next(m), &l, &w, &c, sync ? -1 : batch_marks);
if (!sync) {
- call_comm("event:timer", p, &linecount_restart, 10, end);
+ call_comm("event:timer", p, &linecount_restart, batch_timer, end);
return;
}
}
continue;
do_count(p, owner, m, vmark_next(m), &l, &w, &c, sync ? -1 : batch_marks);
if (!sync) {
- call_comm("event:timer", p, &linecount_restart, 10, end);
+ call_comm("event:timer", p, &linecount_restart, batch_timer, end);
return;
}
}