When "render-lines" determines the range of lines that will fit on the
display is sends a "render:reposition" message to the whole stack with
-marks for the start and end of the visible range. This message is
-normally only sent when there is a change to report. However other
-panes can request the information by sending "render:request:reposition"
-which will cause the "render:reposition" message to be send on the next
-refresh.
+marks for the start and end of the visible range. The number of rows
+and columns displays are also reported as num and num2. These can be
+less than the height and width of the pane, but not more. The are
+calculated at a different time to the start and end marks and so can
+result in a separate "render:reposition" message which doesn't contain
+the marks.
+
+This message is normally only sent when there is a change to report.
+However other panes can request the information by sending
+"render:request:reposition" which will cause the "render:reposition"
+message to be send on the next refresh.
"render-lines" listens for "doc:replaced" notification from the document
and will update the display of anything that has changed. It also
### doc-email
+- [ ] if charset module doesn't load, things go very bad. (utf-8 failure)
- [ ] use mimetypes.guess_type() to interpret filenames in email attachments??
- [ ] don't allow non-text email parts to appear as text. Maybe hex??
const char *cursattr;
short curs_width;
int scale;
+ int width;
const char *line;
int curspos;
};
* be out-of-sync with display manager.
*/
pane_resize(p, p->x, p->y, p->w, y);
+ rd->width = margin + twidth;
attr_set_int(&p->attrs, "line-height", line_height);
while (rlst) {
struct render_list *r = rlst;
snprintf(buf, sizeof(buf), "%d", rd->curs_width);
else if (strcmp(ci->str, "xyattr") == 0)
val = rd->xyattr;
+ else if (strcmp(ci->str, "width") == 0)
+ snprintf(buf, sizeof(buf), "%d", rd->width);
else if (strcmp(ci->str, "cursattr") == 0)
val = rd->cursattr;
else
struct view_data *vd = ci->home->data;
if (!ci->mark)
- return Enoarg;
+ return Efallthrough;
if (!vd->viewpoint || !mark_same(vd->viewpoint, ci->mark)) {
pane_damaged(ci->home, DAMAGED_REFRESH);
draw_line(p, focus, m, -1, refresh_all);
}
if (m->mdata) {
- int cols = m->mdata->x + m->mdata->w;
+ int cols = pane_attr_get_int(m->mdata, "width", 0);
if (cols > rl->cols)
rl->cols = cols;
y = m->mdata->y + m->mdata->h;
struct pane *focus = ci->focus;
struct rl_data *rl = p->data;
struct mark *m, *pm = NULL;
+ int cols = rl->cols;
+ int lines = rl->lines;
//pane_damaged(p, DAMAGED_VIEW);
return 1;
rl->lines = render(pm, p, focus);
+ if (rl->lines != lines || rl->cols != cols)
+ call("render:reposition", focus, rl->lines, NULL, NULL, rl->cols);
return 1;
}