* @param height the new height
*/
public final void setHeight(final int height) {
+ int delta = height - this.height;
this.height = height;
- if (scrollRegionBottom >= height) {
- scrollRegionBottom = height - 1;
+ scrollRegionBottom += delta;
+ if (scrollRegionBottom < 0) {
+ scrollRegionBottom = height;
}
if (scrollRegionTop >= scrollRegionBottom) {
scrollRegionTop = 0;
return sb.toString();
}
- if (keypress.equals(kbBackspace)) {
+ if (keypress.equals(kbBackspaceDel)) {
switch (type) {
case VT100:
return "\010";
// This is EOF
done = true;
} else {
- for (int i = 0; i < rc; i++) {
- int ch = 0;
- if (utf8) {
- ch = readBufferUTF8[i];
- } else {
- ch = readBuffer[i];
- }
+ // Don't step on UI events
+ synchronized (this) {
+ for (int i = 0; i < rc; i++) {
+ int ch = 0;
+ if (utf8) {
+ ch = readBufferUTF8[i];
+ } else {
+ ch = readBuffer[i];
+ }
- synchronized (this) {
- // Don't step on UI events
consume((char)ch);
}
}
// SQUASH
}
+ // Permit my enclosing UI to know that I updated.
+ if (displayListener != null) {
+ displayListener.displayChanged();
+ }
+
// System.err.println("*** run() exiting..."); System.err.flush();
}