[ttssh2-commit] [10780] CSI REP をすべての文字で使用できるように修正した

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2023年 6月 24日 (土) 23:44:55 JST


Revision: 10780
          https://osdn.net/projects/ttssh2/scm/svn/commits/10780
Author:   zmatsuo
Date:     2023-06-24 23:44:54 +0900 (Sat, 24 Jun 2023)
Log Message:
-----------
CSI REP をすべての文字で使用できるように修正した

- 1byte文字しか使用できなかった
- 次のような使い方ができるようになった
  - echo -e "あ\x1b[10b"

ticket #48262

Ticket Links:
------------
    https://osdn.net/projects/ttssh2/tracker/detail/48262

Modified Paths:
--------------
    trunk/teraterm/teraterm/vtterm.c

-------------- next part --------------
Modified: trunk/teraterm/teraterm/vtterm.c
===================================================================
--- trunk/teraterm/teraterm/vtterm.c	2023-06-23 16:08:05 UTC (rev 10779)
+++ trunk/teraterm/teraterm/vtterm.c	2023-06-24 14:44:54 UTC (rev 10780)
@@ -699,61 +699,11 @@
 	BuffPutUnicode(b, Attr, Insert);
 }
 
-static void RepeatChar(BYTE b, int count)
-{
-	int i;
-	BOOL SpecialNew;
-	TCharAttr CharAttrTmp, CharAttrWrap;
-
-	if (b <= US || b == DEL)
-		return;
-
-	CharAttrTmp = CharAttr;
-	LastPutCharacter = 0;
-
-	SpecialNew = CharSetIsSpecial(b);
-	if (SpecialNew != Special) {
-		UpdateStr();
-		Special = SpecialNew;
-	}
-
-	if (Special) {
-		b = b & 0x7F;
-		CharAttrTmp.Attr |= AttrSpecial;
-	}
-	else
-		CharAttrTmp.Attr |= CharAttr.Attr;
-	CharAttrTmp.AttrEx = CharAttrTmp.Attr;
-
-	CharAttrWrap = CharAttrTmp;
-	CharAttrWrap.Attr |= ts.EnableContinuedLineCopy ? AttrLineContinued : 0;
-
-	for (i=0; i<count; i++) {
-		if (Wrap) {
-			CarriageReturn(FALSE);
-			LineFeed(LF,FALSE);
-		}
-
-		BuffPutChar(b, Wrap ? CharAttrWrap : CharAttrTmp, InsertMode);
-
-		if (CursorX == CursorRightM || CursorX >= NumOfColumns-1) {
-			UpdateStr();
-			Wrap = AutoWrapMode;
-		}
-		else {
-			Wrap = FALSE;
-			MoveRight();
-		}
-	}
-}
-
 /**
- *	unicode(UTF-32,wchar_t)\x82\xF0\x83o\x83b\x83t\x83@\x82֏\x91\x82\xAB\x8D\x9E\x82\xDE
- *	\x83\x8D\x83O\x82ɂ\xE0\x8F\x91\x82\xAB\x8D\x9E\x82\xDE
- *
- *	PutChar() \x82\xCC UTF-32\x94\xC5
+ *	unicode(char32_t)\x82\xF0\x83o\x83b\x83t\x83@\x82֏\x91\x82\xAB\x8D\x9E\x82\xDE
+ *		\x83\x8D\x83O\x82ɂ\xE0\x8F\x91\x82\xAB\x8D\x9E\x82ޏꍇ\x82\xCD PutU32() \x82\xF0\x8Eg\x82\xA4
  */
-void PutU32(unsigned int code)
+static void PutU32NoLog(unsigned int code)
 {
 	unsigned short cset;
 	int LineEnd;
@@ -886,11 +836,34 @@
 			assert(FALSE);
 		}
 	}
+}
 
+/**
+ *	unicode(char32_t)\x82\xF0\x83o\x83b\x83t\x83@\x82֏\x91\x82\xAB\x8D\x9E\x82\xDE
+ *	\x83\x8D\x83O\x82ɂ\xE0\x8F\x91\x82\xAB\x8D\x9E\x82\xDE
+ *
+ *	PutChar() \x82\xCC UTF-32\x94\xC5
+ */
+void PutU32(unsigned int code)
+{
+	PutU32NoLog(code);
+
 	// \x83\x8D\x83O\x82\xF0\x8Fo\x97\xCD
 	OutputLogUTF32(code);
 }
 
+static void RepeatChar(char32_t b, int count)
+{
+	int i;
+
+	if (b <= US || b == DEL)
+		return;
+
+	for (i = 0; i < count; i++) {
+		PutU32NoLog(b);
+	}
+}
+
 #if 0
 static void PutChar(BYTE b)
 {
@@ -1906,6 +1879,7 @@
 
 	BuffUpdateScroll();
 	RepeatChar(LastPutCharacter, Param[1]);
+	LastPutCharacter = 0;
 }
 
 static void CSScrollUp()
@@ -5416,7 +5390,7 @@
 
 		PrevCharacter = b;		// memorize previous character for AUTO CR/LF-receive mode
 
-		if (LastPutCharacter != b && !(ParseMode == ModeESC || ParseMode == ModeCSI)) {
+		if ((ParseMode != ModeFirst) && (!(ParseMode == ModeESC || ParseMode == ModeCSI))) {
 			LastPutCharacter = 0;
 		}
 


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