Android-x86
Fork
Spenden

  • R/O
  • HTTP
  • SSH
  • HTTPS

packages-apps-AndroidTerm: Commit

packages/apps/AndroidTerm


Commit MetaInfo

Revisionc4b50ab98ce60a551d2f72876c31c0fecde037cb (tree)
Zeit2012-03-26 10:21:42
AutorSteven Luo <steven+android@stev...>
CommiterJack Palevich

Log Message

Fix emission of combining characters following wide characters in transcript

At the moment, combining characters which follow an East Asian wide
character are not being stored in the same column as the characters they
modify. Fix this by keeping track of the width of the last spacing mark
emitted and using this to place combining characters into the correct
column.

Signed-off-by: Jack Palevich <jackpal@google.com>

Ändern Zusammenfassung

Diff

--- a/src/jackpal/androidterm/session/TerminalEmulator.java
+++ b/src/jackpal/androidterm/session/TerminalEmulator.java
@@ -234,6 +234,12 @@ public class TerminalEmulator {
234234 private boolean mAboutToAutoWrap;
235235
236236 /**
237+ * The width of the last emitted spacing character. Used to place
238+ * combining characters into the correct column.
239+ */
240+ private int mLastEmittedCharWidth = 0;
241+
242+ /**
237243 * True if we just auto-wrapped and no character has been emitted on this
238244 * line yet. Used to ensure combining characters following a character
239245 * at the edge of the screen are stored in the proper place.
@@ -1430,9 +1436,9 @@ public class TerminalEmulator {
14301436 if (width == 0) {
14311437 // Combining character -- store along with character it modifies
14321438 if (mJustWrapped) {
1433- mScreen.set(mColumns - 1, mCursorRow - 1, c, foreColor, backColor);
1439+ mScreen.set(mColumns - mLastEmittedCharWidth, mCursorRow - 1, c, foreColor, backColor);
14341440 } else {
1435- mScreen.set(mCursorCol - 1, mCursorRow, c, foreColor, backColor);
1441+ mScreen.set(mCursorCol - mLastEmittedCharWidth, mCursorRow, c, foreColor, backColor);
14361442 }
14371443 } else {
14381444 mScreen.set(mCursorCol, mCursorRow, c, foreColor, backColor);
@@ -1444,6 +1450,9 @@ public class TerminalEmulator {
14441450 }
14451451
14461452 mCursorCol = Math.min(mCursorCol + width, mColumns - 1);
1453+ if (width > 0) {
1454+ mLastEmittedCharWidth = width;
1455+ }
14471456 }
14481457
14491458 private void emit(int c) {
Show on old repository browser