X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Ftterminal%2FECMA48.java;h=3702b8bc5bc64d3c9e9e454dbdb8179e464aafc0;hb=b2d49e0f15810a35a206e88c9bad11b053ed65fc;hp=96f4e4083cc0bba8085d2df1311492214142017d;hpb=aa77d68274fff56c0ceca162a687ea70795624ea;p=fanfix.git diff --git a/src/jexer/tterminal/ECMA48.java b/src/jexer/tterminal/ECMA48.java index 96f4e40..3702b8b 100644 --- a/src/jexer/tterminal/ECMA48.java +++ b/src/jexer/tterminal/ECMA48.java @@ -567,9 +567,11 @@ public class ECMA48 implements Runnable { * @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; @@ -6081,16 +6083,16 @@ public class ECMA48 implements Runnable { // 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); } } @@ -6124,6 +6126,11 @@ public class ECMA48 implements Runnable { // SQUASH } + // Permit my enclosing UI to know that I updated. + if (displayListener != null) { + displayListener.displayChanged(); + } + // System.err.println("*** run() exiting..."); System.err.flush(); }