diff options
author | Jack Palevich <jack.palevich@gmail.com> | 2012-10-06 17:44:42 -0700 |
---|---|---|
committer | Jack Palevich <jack.palevich@gmail.com> | 2012-10-06 17:44:42 -0700 |
commit | 2ce02c5834fe0792ff9a879b536e59fce80b0762 (patch) | |
tree | 64baca6d2a4ecf28c81570933ebee6269a8d16c9 | |
parent | 230c04bbb10c73c55d897e744aa265ebd227b3c9 (diff) | |
parent | 2ec13618c164871b5861def54b16f162f2ed9f9e (diff) | |
download | AndroidTerm-2ce02c5834fe0792ff9a879b536e59fce80b0762.tar.gz |
Merge pull request #161 from steven676/for-upstream
Miscellaneous bug fixes
3 files changed, 10 insertions, 11 deletions
diff --git a/docs/UTF-8-SMP-chars-demo.txt b/docs/UTF-8-SMP-chars-demo.txt new file mode 100644 index 0000000..3a2e48b --- /dev/null +++ b/docs/UTF-8-SMP-chars-demo.txt @@ -0,0 +1,2 @@ +These are some characters in the Supplementary Multilingual Plane: +𝄞 𝄴𝅘𝅥𝅯𝅗𝅥 𝑥𝄽 diff --git a/libraries/emulatorview/src/jackpal/androidterm/emulatorview/TranscriptScreen.java b/libraries/emulatorview/src/jackpal/androidterm/emulatorview/TranscriptScreen.java index 99fe829..2acd67f 100644 --- a/libraries/emulatorview/src/jackpal/androidterm/emulatorview/TranscriptScreen.java +++ b/libraries/emulatorview/src/jackpal/androidterm/emulatorview/TranscriptScreen.java @@ -204,19 +204,16 @@ class TranscriptScreen implements Screen { int lastRunStart = -1; int lastRunStartIndex = -1; boolean forceFlushRun = false; - char cHigh = 0; int column = 0; int index = 0; while (column < columns) { - int style; + int style = color.get(column); boolean cursorStyle = false; - style = color.get(column); + int incr = 1; int width; if (Character.isHighSurrogate(line[index])) { - cHigh = line[index++]; - continue; - } else if (Character.isLowSurrogate(line[index])) { - width = UnicodeTranscript.charWidth(cHigh, line[index]); + width = UnicodeTranscript.charWidth(line, index); + incr++; } else { width = UnicodeTranscript.charWidth(line[index]); } @@ -242,7 +239,7 @@ class TranscriptScreen implements Screen { } runWidth += width; column += width; - index++; + index += incr; if (width > 1) { /* We cannot draw two or more East Asian wide characters in the same run, because we need to make each wide character take @@ -350,7 +347,7 @@ class TranscriptScreen implements Screen { char c = line[i]; if (c == 0) { break; - } else if (c != ' ' || (rowColorBuffer.get(column) != defaultColor)) { + } else if (c != ' ' || ((rowColorBuffer != null) && (rowColorBuffer.get(column) != defaultColor))) { lastPrintingChar = i; } if (!Character.isLowSurrogate(c)) { diff --git a/libraries/emulatorview/src/jackpal/androidterm/emulatorview/UnicodeTranscript.java b/libraries/emulatorview/src/jackpal/androidterm/emulatorview/UnicodeTranscript.java index 584b643..8254403 100644 --- a/libraries/emulatorview/src/jackpal/androidterm/emulatorview/UnicodeTranscript.java +++ b/libraries/emulatorview/src/jackpal/androidterm/emulatorview/UnicodeTranscript.java @@ -964,7 +964,7 @@ class FullUnicodeLine { int nextWidth = UnicodeTranscript.charWidth(text, nextPos); int nextLen; if (column + nextWidth + 1 < columns) { - nextLen = findStartOfColumn(column + nextWidth + 1) - nextPos; + nextLen = findStartOfColumn(column + nextWidth + 1) + shift - nextPos; } else { nextLen = spaceUsed - nextPos; } @@ -983,7 +983,7 @@ class FullUnicodeLine { shift -= nextLen; // Truncate the line - offset[0] = (short) findStartOfColumn(columns - 1); + offset[0] -= nextLen; } // Correct the offset for the next column to reflect width change |