*/
struct buf b;
struct point **ptp = ci->pointp;
- struct doc *d = (*ptp)->doc;
+ struct doc *d;
struct mark *m = ci->mark;
int o = ci->numeric;
wint_t ch = WEOF;
int chars = 0;
+ if (!m || !ptp)
+ return -1;
+ d = (*ptp)->doc;
+
buf_init(&b);
while (1) {
char *attr = __text_get_attr(d, m, 1, "highlight");
*/
struct cmd_info ci2 = {0};
struct complete_data *cd = ci->home->data;
- struct doc *d = (*ci->pointp)->doc;
+ struct doc *d;
int plen;
+ if (!ci->pointp || !ci->mark)
+ return -1;
+ d = (*ci->pointp)->doc;
ci2.key = ci->key;
ci2.mark = ci->mark;
ci2.pointp = ci->pointp;
/* Need to interpose a new pane between the 'render-lines' pane,
* which we assume is 'ci->focus' and its parent, so we can
* re-interpret lines.
- * Find the 'render-line-prev' pane by sending a render-lines request
- * and grabbing 'home'
+ * Find the 'render-line-prev' pane by sending a render-line request
+ * (with NULLs so it fails) and grabbing 'home'
*/
- ci2.key = "render-line-prev";
- ci2.pointp = ci->pointp;
- ci2.numeric = 0;
- ci2.mark = mark_at_point(*ci->pointp, MARK_UNGROUPED);
+ ci2.key = "render-line";
ci2.focus = ci->focus;
- key_handle_focus(&ci2);
+ if (key_handle_focus(&ci2) == 0)
+ return -1;
parent = ci2.home;
lines = pane_child(parent);
mark_free(ci2.mark);
char *body = pane_attr_get(ci->focus, "line-format");
struct rf_data *rf = ci->home->data;
struct buf ret;
- struct doc *d = (*ci->pointp)->doc;
+ struct doc *d;
struct mark *m = ci->mark;
char *n;
wint_t ch;
int home;
int field = 0;
+ if (!ci->pointp || !ci->mark)
+ return -1;
+
+ d = (*ci->pointp)->doc;
if (RPT_NUM(ci) < 0 &&
!mark_same(d, &(*ci->pointp)->m, m))
ci->numeric = NO_NUMERIC;
{
struct buf ret;
struct point **ptp = ci->pointp;
- struct doc *d = (*ptp)->doc;
+ struct doc *d;
struct cmd_info ci2 = {0};
struct mark *m = NULL;
int pos;
int i;
char buf[10];
+ if (!ptp || !ci->mark)
+ return -1;
+ d = (*ptp)->doc;
ci2.key = "CountLines";
ci2.pointp = ptp;
ci2.mark = ci->mark;