};
void view_init(View* view, char* file);
+void view_sync(View* view);
void view_reload(View* view);
size_t view_limitrows(View* view, size_t maxrows);
void view_resize(View* view, size_t width, size_t nrows);
}
}
+void view_sync(View* view) {
+ view->sync_flags |= (CURSOR|CENTER);
+}
+
static size_t rune_width(View* view, int c, size_t xpos, size_t width) {
if (c == '\r')
return 0;
static void xconfigure(XConf* x, XEvent* e) {
if (e->xconfigure.window != x->self) return;
- x11_resize(x, e);
- if (e->xconfigure.width != x->width || e->xconfigure.height != x->height) {
+ if (e->xconfigure.width != x->width || e->xconfigure.height != x->height)
retile = 1;
- }
+ x11_resize(x, e);
}
static void xclientmsg(XConf* x, XEvent* e) {
win_setln(e->xclient.data.l[0]);
}
+void xresize(XConf* x, XEvent* e) {
+ if (e->xconfigure.width != x->width || e->xconfigure.height != x->height)
+ view_sync(win_view(EDIT));
+ x11_resize(x, e);
+}
+
static void xredraw(XConf* x) {
/* force update the title */
win_title(NULL);
X.eventfns[ButtonRelease] = xmousebtn;
X.eventfns[MotionNotify] = xbtnmotion;
X.eventfns[ClientMessage] = xclientmsg;
+ X.eventfns[ConfigureNotify] = xresize;
}
void win_title(char* path) {