git.y1.nz

mtm

Ncurses-based terminal multiplexer
download: https://git.y1.nz/archives/mtm.tar.gz
Files | Log | Refs

commit 2fd92c56b93639115b8029faad33d27400740bb3
parent 3ffcfb07f3487e6026ce949f707890c6e082aced
Author: Rob King <jking@deadpixi.com>
Date:   Mon, 16 Apr 2018 21:10:35 -0500

vtparser can't fail init

Diffstat:
Mmtm.c2--
Mvtparser.c10+---------
Mvtparser.h3---
3 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/mtm.c b/mtm.c @@ -527,8 +527,6 @@ newview(NODE *p, int y, int x, int h, int w) /* Open a new view. */ idlok(n->win, TRUE); keypad(n->win, TRUE); - if (!vtparser_init(&n->vp, n)) - return freenode(n, false), NULL; setupevents(n); ris(&n->vp, n, L'c', 0, 0, NULL, NULL); diff --git a/vtparser.c b/vtparser.c @@ -94,15 +94,6 @@ DO(print, v->print, v->print, 0, NULL) DO(osc, v->osc, v->osc, 0, NULL) /**** PUBLIC FUNCTIONS */ -bool -vtparser_init(VTPARSER *v, void *p) -{ - v->s = &ground; - v->p = p; - - return v; -} - VTCALLBACK vtparser_onevent(VTPARSER *vp, VtEvent t, wchar_t w, VTCALLBACK cb) { @@ -121,6 +112,7 @@ vtparser_onevent(VTPARSER *vp, VtEvent t, wchar_t w, VTCALLBACK cb) static void handlechar(VTPARSER *vp, wchar_t w) { + vp->s = vp->s? vp->s : &ground; for (ACTION *a = vp->s->actions; a->cb; a++) if (w >= a->lo && w <= a->hi){ a->cb(vp, w); if (a->next){ diff --git a/vtparser.h b/vtparser.h @@ -76,9 +76,6 @@ typedef enum{ } VtEvent; /**** FUNCTIONS */ -bool -vtparser_init(VTPARSER *, void *p); - VTCALLBACK vtparser_onevent(VTPARSER *vp, VtEvent t, wchar_t w, VTCALLBACK cb);

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.