From: Michael D. Lowis Date: Tue, 18 Dec 2018 01:51:26 +0000 (-0500) Subject: fixed segfault in Get tag command X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=dbcd4b65bb38cee390d59d4a04b00bf6d54e5319;p=projs%2Ftide.git fixed segfault in Get tag command --- diff --git a/TODO.md b/TODO.md index 3183fed..7850db7 100644 --- a/TODO.md +++ b/TODO.md @@ -2,6 +2,7 @@ ## STAGING +* Ctrl+D should not pass tag name as arg when executing tag commands * registrar doesnt match open windows when new file created and is then opened for edit or line number * implement a mini-sed command to standardize scripts across platforms without relying on sed * registrar should remove invalid windows from registry when detected diff --git a/src/lib/view.c b/src/lib/view.c index 0348c0a..e505621 100644 --- a/src/lib/view.c +++ b/src/lib/view.c @@ -161,7 +161,7 @@ static void resize(View* view, size_t width, size_t nrows, size_t off) { void view_resize(View* view, size_t width, size_t nrows) { if (view->width == width && view->nvisible == nrows) return; - size_t off = (view->rows ? view->rows[view->index]->off : 0); + size_t off = (view->nrows && view->index < view->nrows ? view->rows[view->index]->off : 0); resize(view, width, nrows, off); }