j += (flags[i] != 0);
assert(j == line->size);
+
+ sfree(flags);
}
/*
hdrpos = b->len;
hdrsize = 0;
add(b, 0);
+ /* And ensure this run doesn't interfere with the next. */
+ prevlen = prevpos = 0;
+ prev2 = FALSE;
continue;
} else {
/*
* Diagnostics: ensure that the compressed data really does
* decompress to the right thing.
+ *
+ * XXX-REMOVE-BEFORE-RELEASE: This is a bit performance-heavy
+ * to be leaving in production code.
*/
#ifndef CHECK_SB_COMPRESSION
{
if (term->cfg.wordness[i] != cfg->wordness[i])
reset_charclass = 1;
+ /*
+ * If the bidi or shaping settings have changed, flush the bidi
+ * cache completely.
+ */
+ if (term->cfg.arabicshaping != cfg->arabicshaping ||
+ term->cfg.bidi != cfg->bidi) {
+ for (i = 0; i < term->bidi_cache_size; i++) {
+ sfree(term->pre_bidi_cache[i].chars);
+ sfree(term->post_bidi_cache[i].chars);
+ term->pre_bidi_cache[i].width = -1;
+ term->pre_bidi_cache[i].chars = NULL;
+ term->post_bidi_cache[i].width = -1;
+ term->post_bidi_cache[i].chars = NULL;
+ }
+ }
+
term->cfg = *cfg; /* STRUCTURE COPY */
if (reset_wrap)
for (i = 0; i < newrows; i++) {
newdisp[i] = newline(term, newcols, FALSE);
for (j = 0; j < newcols; j++)
- newdisp[i]->chars[i].attr = ATTR_INVALID;
+ newdisp[i]->chars[j].attr = ATTR_INVALID;
}
if (term->disptext) {
for (i = 0; i < oldrows; i++)
addpos234(term->scrollback, compressline(line), sblen);
- line = newline(term, term->cols, TRUE);
+ /* now `line' itself can be reused as the bottom line */
/*
* If the user is currently looking at part of the
term->wrapnext = FALSE;
/* destructive backspace might be disabled */
if (!term->cfg.no_dbackspace) {
+ check_boundary(term, term->curs.x, term->curs.y);
+ check_boundary(term, term->curs.x+1, term->curs.y);
copy_termchar(scrlineptr(term->curs.y),
term->curs.x, &term->erase_char);
}
tchar = d->chr;
tattr = d->attr;
+ if (!term->cfg.ansi_colour)
+ tattr = (tattr & ~(ATTR_FGMASK | ATTR_BGMASK)) |
+ ATTR_DEFFG | ATTR_DEFBG;
+
switch (tchar & CSET_MASK) {
case CSET_ASCII:
tchar = term->ucsdata->unitab_line[tchar & 0xFF];
*/
if (!(ldata->lattr & LATTR_WRAPPED)) {
while (IS_SPACE_CHR(ldata->chars[nlpos.x - 1].chr) &&
+ !ldata->chars[nlpos.x - 1].cc_next &&
poslt(top, nlpos))
decpos(nlpos);
if (poslt(nlpos, bottom))
*/
if (!(ldata->lattr & LATTR_WRAPPED)) {
termchar *q = ldata->chars + term->cols;
- while (q > ldata->chars && IS_SPACE_CHR(q[-1].chr))
+ while (q > ldata->chars &&
+ IS_SPACE_CHR(q[-1].chr) && !q[-1].cc_next)
q--;
if (q == ldata->chars + term->cols)
q--;