From aea7341eefa1fd2d1cc7d8ba8530510b5090c53a Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Fri, 12 Feb 2010 05:40:56 +0000 Subject: Extra checking for scrolling wide characters git-svn-id: https://connectbot.googlecode.com/svn/trunk/connectbot@478 df292f66-193f-0410-a5fc-6d59da041ff2 --- AndroidManifest.xml | 2 +- src/de/mud/terminal/vt320.java | 38 ++++++++++++++++++++++++-------------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index f879507..1c4b050 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,7 +2,7 @@ + android:versionCode="257"> = 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) { -- cgit v1.2.3