~mdw
/
sgt
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Malcolm Rowe's UI tweak patch for About/Licence: recognise `Esc' to close
[sgt/putty]
/
terminal.c
diff --git
a/terminal.c
b/terminal.c
index
0de47f9
..
1a65e71
100644
(file)
--- a/
terminal.c
+++ b/
terminal.c
@@
-177,6
+177,8
@@
static void cc_check(termline *line)
j += (flags[i] != 0);
assert(j == line->size);
j += (flags[i] != 0);
assert(j == line->size);
+
+ sfree(flags);
}
/*
}
/*
@@
-433,6
+435,9
@@
static void makerle(struct buf *b, termline *ldata,
hdrpos = b->len;
hdrsize = 0;
add(b, 0);
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 {
continue;
} else {
@@
-634,6
+639,9
@@
static unsigned char *compressline(termline *ldata)
/*
* Diagnostics: ensure that the compressed data really does
* decompress to the right thing.
/*
* 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
{
*/
#ifndef CHECK_SB_COMPRESSION
{
@@
-1664,7
+1672,7
@@
static void scroll(Terminal *term, int topline, int botline, int lines, int sb)
addpos234(term->scrollback, compressline(line), sblen);
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
/*
* If the user is currently looking at part of the
@@
-2461,6
+2469,8
@@
void term_out(Terminal *term)
term->wrapnext = FALSE;
/* destructive backspace might be disabled */
if (!term->cfg.no_dbackspace) {
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);
}
copy_termchar(scrlineptr(term->curs.y),
term->curs.x, &term->erase_char);
}
@@
-4801,6
+4811,7
@@
static void clipme(Terminal *term, pos top, pos bottom, int rect, int desel)
*/
if (!(ldata->lattr & LATTR_WRAPPED)) {
while (IS_SPACE_CHR(ldata->chars[nlpos.x - 1].chr) &&
*/
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))
poslt(top, nlpos))
decpos(nlpos);
if (poslt(nlpos, bottom))
@@
-5073,7
+5084,8
@@
static pos sel_spread_half(Terminal *term, pos p, int dir)
*/
if (!(ldata->lattr & LATTR_WRAPPED)) {
termchar *q = ldata->chars + term->cols;
*/
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--;
q--;
if (q == ldata->chars + term->cols)
q--;