version 1.61, 2006/07/08 17:50:30 |
version 1.62, 2006/07/25 08:22:32 |
|
|
} |
} |
if (bp == curbp) |
if (bp == curbp) |
curbp = bp1; |
curbp = bp1; |
free(bp->b_linep); /* Release header line. */ |
free(bp->b_headp); /* Release header line. */ |
bp2 = NULL; /* Find the header. */ |
bp2 = NULL; /* Find the header. */ |
bp1 = bheadp; |
bp1 = bheadp; |
while (bp1 != bp) { |
while (bp1 != bp) { |
|
|
|
|
nbytes = 0; /* Count bytes in buf. */ |
nbytes = 0; /* Count bytes in buf. */ |
if (bp != blp) { |
if (bp != blp) { |
lp = lforw(bp->b_linep); |
lp = lforw(bp->b_headp); |
while (lp != bp->b_linep) { |
while (lp != bp->b_headp) { |
nbytes += llength(lp) + 1; |
nbytes += llength(lp) + 1; |
lp = lforw(lp); |
lp = lforw(lp); |
} |
} |
|
|
bp->b_fname) == FALSE) |
bp->b_fname) == FALSE) |
return (NULL); |
return (NULL); |
} |
} |
blp->b_dotp = lforw(blp->b_linep); /* put dot at beginning of |
blp->b_dotp = lforw(blp->b_headp); /* put dot at beginning of |
* buffer */ |
* buffer */ |
blp->b_doto = 0; |
blp->b_doto = 0; |
return (blp); /* All done */ |
return (blp); /* All done */ |
|
|
lp->l_used = strlen(lp->l_text); |
lp->l_used = strlen(lp->l_text); |
va_end(ap); |
va_end(ap); |
|
|
bp->b_linep->l_bp->l_fp = lp; /* Hook onto the end */ |
bp->b_headp->l_bp->l_fp = lp; /* Hook onto the end */ |
lp->l_bp = bp->b_linep->l_bp; |
lp->l_bp = bp->b_headp->l_bp; |
bp->b_linep->l_bp = lp; |
bp->b_headp->l_bp = lp; |
lp->l_fp = bp->b_linep; |
lp->l_fp = bp->b_headp; |
bp->b_lines++; |
bp->b_lines++; |
|
|
return (TRUE); |
return (TRUE); |
|
|
bp->b_marko = 0; |
bp->b_marko = 0; |
bp->b_flag = defb_flag; |
bp->b_flag = defb_flag; |
bp->b_nwnd = 0; |
bp->b_nwnd = 0; |
bp->b_linep = lp; |
bp->b_headp = lp; |
bp->b_nmodes = defb_nmodes; |
bp->b_nmodes = defb_nmodes; |
LIST_INIT(&bp->b_undo); |
LIST_INIT(&bp->b_undo); |
bp->b_undoptr = NULL; |
bp->b_undoptr = NULL; |
|
|
(s = eyesno("Buffer modified; kill anyway")) != TRUE) |
(s = eyesno("Buffer modified; kill anyway")) != TRUE) |
return (s); |
return (s); |
bp->b_flag &= ~BFCHG; /* Not changed */ |
bp->b_flag &= ~BFCHG; /* Not changed */ |
while ((lp = lforw(bp->b_linep)) != bp->b_linep) |
while ((lp = lforw(bp->b_headp)) != bp->b_headp) |
lfree(lp); |
lfree(lp); |
bp->b_dotp = bp->b_linep; /* Fix dot */ |
bp->b_dotp = bp->b_headp; /* Fix dot */ |
bp->b_doto = 0; |
bp->b_doto = 0; |
bp->b_markp = NULL; /* Invalidate "mark" */ |
bp->b_markp = NULL; /* Invalidate "mark" */ |
bp->b_marko = 0; |
bp->b_marko = 0; |
|
|
} |
} |
/* insert the buffer */ |
/* insert the buffer */ |
nline = 0; |
nline = 0; |
clp = lforw(bp->b_linep); |
clp = lforw(bp->b_headp); |
for (;;) { |
for (;;) { |
for (clo = 0; clo < llength(clp); clo++) |
for (clo = 0; clo < llength(clp); clo++) |
if (linsert(1, lgetc(clp, clo)) == FALSE) |
if (linsert(1, lgetc(clp, clo)) == FALSE) |
return (FALSE); |
return (FALSE); |
if ((clp = lforw(clp)) == bp->b_linep) |
if ((clp = lforw(clp)) == bp->b_headp) |
break; |
break; |
if (newline(FFRAND, 1) == FALSE) /* fake newline */ |
if (newline(FFRAND, 1) == FALSE) /* fake newline */ |
return (FALSE); |
return (FALSE); |
|
|
|
|
clp = curwp->w_linep; /* cosmetic adjustment */ |
clp = curwp->w_linep; /* cosmetic adjustment */ |
if (curwp->w_dotp == clp) { /* for offscreen insert */ |
if (curwp->w_dotp == clp) { /* for offscreen insert */ |
while (nline-- && lback(clp) != curbp->b_linep) |
while (nline-- && lback(clp) != curbp->b_headp) |
clp = lback(clp); |
clp = lback(clp); |
curwp->w_linep = clp; /* adjust framing. */ |
curwp->w_linep = clp; /* adjust framing. */ |
curwp->w_flag |= WFFULL; |
curwp->w_flag |= WFFULL; |
|
|
{ |
{ |
struct mgwin *wp; |
struct mgwin *wp; |
|
|
bp->b_dotp = lforw(bp->b_linep); |
bp->b_dotp = lforw(bp->b_headp); |
bp->b_doto = 0; |
bp->b_doto = 0; |
if (bp->b_nwnd != 0) { |
if (bp->b_nwnd != 0) { |
for (wp = wheadp; wp != NULL; wp = wp->w_wndp) |
for (wp = wheadp; wp != NULL; wp = wp->w_wndp) |