[Ttssh2-commit] [8238] ECHが動作するよう修正

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2019年 9月 30日 (月) 00:42:37 JST


Revision: 8238
          https://osdn.net/projects/ttssh2/scm/svn/commits/8238
Author:   zmatsuo
Date:     2019-09-30 00:42:37 +0900 (Mon, 30 Sep 2019)
Log Message:
-----------
ECHが動作するよう修正

- unicodebuf-ech.sh (r8099)

Revision Links:
--------------
    https://osdn.net/projects/ttssh2/scm/svn/commits/8099

Modified Paths:
--------------
    branches/unicode_buf/teraterm/teraterm/buffer.c
    branches/unicode_buf/teraterm/teraterm/vtterm.c

-------------- next part --------------
Modified: branches/unicode_buf/teraterm/teraterm/buffer.c
===================================================================
--- branches/unicode_buf/teraterm/teraterm/buffer.c	2019-09-28 14:10:35 UTC (rev 8237)
+++ branches/unicode_buf/teraterm/teraterm/buffer.c	2019-09-29 15:42:37 UTC (rev 8238)
@@ -1229,10 +1229,61 @@
 }
 #endif
 
-void BuffEraseChars(int Count)
 // Erase characters in current line from cursor
 //   Count: number of characters to be deleted
+#if UNICODE_INTERNAL_BUFF
+void BuffEraseChars(int Count)
 {
+	int extr = 0;
+	int sx = CursorX;
+	buff_char_t *b;
+	NewLine(PageStart + CursorY);
+
+	if (Count > NumOfColumns - CursorX) {
+		Count = NumOfColumns - CursorX;
+	}
+
+	b = &CodeLineW[CursorX];
+	if (IsBuffPadding(b)) {
+		// \x91S\x8Ap\x82̉E\x91\xA4\x81A\x91S\x8Ap\x82\xF0\x83X\x83y\x81[\x83X\x82ɒu\x82\xAB\x8A\xB7\x82\xA6\x82\xE9
+		BuffSetChar(b - 1, ' ', 'H');
+		BuffSetChar(b, ' ', 'H');
+		sx--;
+		extr++;
+	}
+	if (IsBuffFullWidth(b)) {
+		// \x91S\x8Ap\x82̍\xB6\x91\xA4\x81A\x91S\x8Ap\x82\xF0\x83X\x83y\x81[\x83X\x82ɒu\x82\xAB\x8A\xB7\x82\xA6\x82\xE9
+		BuffSetChar(b, ' ', 'H');
+		BuffSetChar(b + 1, ' ', 'H');
+		if (Count == 1) {
+			extr++;
+		}
+	}
+	if (Count > 1) {
+		// \x8FI\x92[\x82\xF0\x83`\x83F\x83b\x83N
+		if (IsBuffPadding(b + Count)) {
+			// \x91S\x8Ap\x82̉E\x91\xA4\x81A\x91S\x8Ap\x82\xF0\x83X\x83y\x81[\x83X\x82ɒu\x82\xAB\x8A\xB7\x82\xA6\x82\xE9
+			BuffSetChar(b + Count - 1, ' ', 'H');
+			BuffSetChar(b + Count, ' ', 'H');
+			extr++;
+		}
+	}
+
+	memset(&(CodeLine[CursorX]), 0x20, Count);
+#if UNICODE_INTERNAL_BUFF
+	memsetW(&(CodeLineW[CursorX]), 0x20, Count);
+#endif
+	memset(&(AttrLine[CursorX]), AttrDefault, Count);
+	memset(&(AttrLine2[CursorX]), CurCharAttr.Attr2 & Attr2ColorMask, Count);
+	memset(&(AttrLineFG[CursorX]), CurCharAttr.Fore, Count);
+	memset(&(AttrLineBG[CursorX]), CurCharAttr.Back, Count);
+
+	/* update window */
+	DispEraseCharsInLine(sx, Count + extr);
+}
+#else
+void BuffEraseChars(int Count)
+{
 	NewLine(PageStart+CursorY);
 
 	if (ts.Language==IdJapanese || ts.Language==IdKorean || ts.Language==IdUtf8) {
@@ -1255,6 +1306,7 @@
 	/* update window */
 	DispEraseCharsInLine(CursorX,Count);
 }
+#endif
 
 void BuffFillWithE()
 // Fill screen with 'E' characters

Modified: branches/unicode_buf/teraterm/teraterm/vtterm.c
===================================================================
--- branches/unicode_buf/teraterm/teraterm/vtterm.c	2019-09-28 14:10:35 UTC (rev 8237)
+++ branches/unicode_buf/teraterm/teraterm/vtterm.c	2019-09-29 15:42:37 UTC (rev 8238)
@@ -1864,7 +1864,8 @@
 	BuffDeleteChars(Param[1]);
 }
 
-void CSEraseCharacter()		// ECH
+// ECH
+static void CSEraseCharacter(void)
 {
 	CheckParamVal(Param[1], NumOfColumns);
 


Ttssh2-commit メーリングリストの案内
Back to archive index