DEF_CMD(count_lines)
{
- struct point *pt = *ci->pointp;
- struct doc *d = pt->doc;
+ struct pane *dp = doc_get_pane(ci->home);
+ struct doc *d = dp->data;
/* FIXME optimise this away most of the time */
count_calculate(d, NULL, NULL);
- count_calculate(d, NULL, &pt->m);
if (ci->mark)
count_calculate(d, NULL, ci->mark);
+ if (ci->mark2)
+ count_calculate(d, NULL, ci->mark2);
return 1;
}
if (p->h > 4) {
ci2.key = "CountLines";
- ci2.pointp = ci->pointp;
+ ci2.home = ci2.focus = p;
+ ci2.mark = &pt->m;
key_lookup(pt->doc->ed->commands, &ci2);
ln = attr_find_int(*mark_attr(&pt->m), "lines");
struct cmd_info ci2 = {0};
ci2.key = "CountLines";
- ci2.pointp = ptp;
+ ci2.home = ci2.focus = ci->home;
ci2.mark = ci->mark;
key_lookup(d->ed->commands, &ci2);
pos = attr_find_int(*mark_attr(ci->mark), "chars");
return -1;
d = (*ptp)->doc;
ci2.key = "CountLines";
- ci2.pointp = ptp;
+ ci2.home = ci2.focus = ci->home;
ci2.mark = ci->mark;
key_lookup(d->ed->commands, &ci2);
pos = attr_find_int(*mark_attr(ci->mark), "chars");
int to, from;
ci2.key = "CountLines";
- ci2.pointp = ptp;
+ ci2.home = ci2.focus = ci->home;
ci2.mark = ci->mark;
key_lookup(d->ed->commands, &ci2);