From: Michael D. Lowis Date: Mon, 7 May 2018 18:19:53 +0000 (-0400) Subject: fixed bad memory access in view code and fixed the default background color X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=e3874737bdf38c19a3ad955f1231d39fa166d1e6;p=projs%2Ftide.git fixed bad memory access in view code and fixed the default background color --- diff --git a/lib/view.c b/lib/view.c index 61761e8..87b1389 100644 --- a/lib/view.c +++ b/lib/view.c @@ -173,8 +173,9 @@ void view_update(View* view, size_t* csrx, size_t* csry) { view_scroll(view, UP * (view->nvisible/2)); } else { Row* lastrow = view->rows[view->nrows-1]; + size_t last_off = lastrow->cols[lastrow->len-1].off; view_scrollto(view, CSRPOS); - if (lastrow->cols[lastrow->len-1].off < CSRPOS) + if (last_off < CSRPOS) view_scroll(view, UP * (view->nvisible-1)); } view->sync_flags = 0; diff --git a/lib/x11.c b/lib/x11.c index b0a2b7b..be9057e 100644 --- a/lib/x11.c +++ b/lib/x11.c @@ -122,7 +122,7 @@ static void x11_window(char* name) { X.width, X.height, 0, X.depth, - Palette[0]); + Palette[EditBg]); /* register interest in the delete window message */ Atom wmDeleteMessage = XInternAtom(X.display, "WM_DELETE_WINDOW", False); XSetWMProtocols(X.display, X.self, &wmDeleteMessage, 1);