aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2010-02-12 05:40:56 +0000
committerKenny Root <kenny@the-b.org>2010-02-12 05:40:56 +0000
commitaea7341eefa1fd2d1cc7d8ba8530510b5090c53a (patch)
tree7a79fda34beaebc52070deb656d91ab6c60685da /src
parent287a7c95475417cd3bc4a7a5ed7b4b27905af6b9 (diff)
downloadconnectbot-aea7341eefa1fd2d1cc7d8ba8530510b5090c53a.tar.gz
connectbot-aea7341eefa1fd2d1cc7d8ba8530510b5090c53a.tar.bz2
connectbot-aea7341eefa1fd2d1cc7d8ba8530510b5090c53a.zip
Extra checking for scrolling wide characters
git-svn-id: https://connectbot.googlecode.com/svn/trunk/connectbot@478 df292f66-193f-0410-a5fc-6d59da041ff2
Diffstat (limited to 'src')
-rw-r--r--src/de/mud/terminal/vt320.java38
1 files changed, 24 insertions, 14 deletions
diff --git a/src/de/mud/terminal/vt320.java b/src/de/mud/terminal/vt320.java
index a09deff..10fd231 100644
--- a/src/de/mud/terminal/vt320.java
+++ b/src/de/mud/terminal/vt320.java
@@ -1774,33 +1774,43 @@ public void setScreenSize(int c, int r, boolean broadcast) {
c = map_cp850_unicode(c);
/*if(true || (statusmode == 0)) { */
- if (insertmode == 1) {
- if (isWide) {
- if (C >= columns - 1) {
- C = 0;
- if (R == getBottomMargin() || R == rows - 1)
+ if (isWide) {
+ if (C >= columns - 1) {
+ if (wraparound) {
+ int bot = rows;
+
+ // If we're in the scroll region, check against the bottom margin
+ if (R <= getBottomMargin() && R >= getTopMargin())
+ bot = getBottomMargin() + 1;
+
+ if (R < bot - 1)
+ R++;
+ else {
+ if (debug > 3) debug("scrolling due to wrap at " + R);
insertLine(R, 1, SCROLL_UP);
- else
- R++;
+ }
+ C = 0;
+ } else {
+ // cursor stays on last wide character.
+ C = columns - 2;
}
+ }
+ }
+
+ if (insertmode == 1) {
+ if (isWide) {
insertChar(C++, R, c, attributes | FULLWIDTH);
insertChar(C, R, ' ', attributes | FULLWIDTH);
} else
insertChar(C, R, c, attributes);
} else {
if (isWide) {
- if (C >= columns - 1) {
- C = 0;
- if (R == getBottomMargin() || R == rows - 1)
- insertLine(R, 1, SCROLL_UP);
- else
- R++;
- }
putChar(C++, R, c, attributes | FULLWIDTH);
putChar(C, R, ' ', attributes | FULLWIDTH);
} else
putChar(C, R, c, attributes);
}
+
/*
} else {
if (insertmode==1) {