From 8f11345fa9687e48c991b2775bbae5377b7580c7 Mon Sep 17 00:00:00 2001 From: bostic Date: Tue, 28 Dec 1993 11:47:50 +0000 Subject: [PATCH] make cut buffer displays interruptible --- ex/ex_display.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ex/ex_display.c b/ex/ex_display.c index ee67b467..cad9e3b8 100644 --- a/ex/ex_display.c +++ b/ex/ex_display.c @@ -6,7 +6,7 @@ */ #ifndef lint -static char sccsid[] = "$Id: ex_display.c,v 8.12 1993/12/02 10:55:03 bostic Exp $ (Berkeley) $Date: 1993/12/02 10:55:03 $"; +static char sccsid[] = "$Id: ex_display.c,v 8.13 1993/12/28 11:47:50 bostic Exp $ (Berkeley) $Date: 1993/12/28 11:47:50 $"; #endif /* not lint */ #include @@ -63,12 +63,17 @@ bdisplay(sp, ep) return (0); } + /* Buffers can be infinitely long, make it interruptible. */ + F_SET(sp, S_INTERRUPTIBLE); + /* Display regular cut buffers. */ for (cbp = sp->gp->cutq.lh_first; cbp != NULL; cbp = cbp->q.le_next) { if (isdigit(cbp->name)) continue; if (cbp->textq.cqh_first != (void *)&cbp->textq) db(sp, cbp); + if (F_ISSET(sp, S_INTERRUPTED)) + return (0); } /* Display numbered buffers. */ for (cbp = sp->gp->cutq.lh_first; cbp != NULL; cbp = cbp->q.le_next) { @@ -76,6 +81,8 @@ bdisplay(sp, ep) continue; if (cbp->textq.cqh_first != (void *)&cbp->textq) db(sp, cbp); + if (F_ISSET(sp, S_INTERRUPTED)) + return (0); } return (0); } @@ -97,8 +104,11 @@ db(sp, cbp) F_ISSET(cbp, CB_LMODE) ? " (line mode)" : ""); for (tp = cbp->textq.cqh_first; tp != (void *)&cbp->textq; tp = tp->q.cqe_next) { - for (len = tp->len, p = tp->lb; len--;) + for (len = tp->len, p = tp->lb; len--;) { (void)ex_printf(EXCOOKIE, "%s", charname(sp, *p++)); + if (F_ISSET(sp, S_INTERRUPTED)) + return; + } (void)ex_printf(EXCOOKIE, "\n"); } } -- 2.11.4.GIT