svnno****@sourc*****
svnno****@sourc*****
2013年 6月 18日 (火) 02:54:36 JST
Revision: 5326 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5326 Author: doda Date: 2013-06-18 02:54:32 +0900 (Tue, 18 Jun 2013) Log Message: ----------- 左右マージン外では ICH で何も行わないようにした。(VT525の動作に合わせた) Modified Paths: -------------- trunk/teraterm/teraterm/buffer.c -------------- next part -------------- Modified: trunk/teraterm/teraterm/buffer.c =================================================================== --- trunk/teraterm/teraterm/buffer.c 2013-06-17 17:47:08 UTC (rev 5325) +++ trunk/teraterm/teraterm/buffer.c 2013-06-17 17:54:32 UTC (rev 5326) @@ -561,23 +561,21 @@ // Insert space characters at the current position // Count: Number of characters to be inserted { - int LineEnd, MoveLen; + int MoveLen; + if (CursorX < CursorLeftM || CursorX > CursorRightM) + return; + NewLine(PageStart+CursorY); if (ts.Language==IdJapanese || ts.Language==IdKorean || ts.Language==IdUtf8) EraseKanji(1); /* if cursor is on right half of a kanji, erase the kanji */ - if (CursorX > CursorRightM) - LineEnd = NumOfColumns - 1; - else - LineEnd = CursorRightM; + if (Count > CursorRightM + 1 - CursorX) + Count = CursorRightM + 1 - CursorX; - if (Count > LineEnd - CursorX) - Count = LineEnd + 1 - CursorX; + MoveLen = CursorRightM + 1 - CursorX - Count; - MoveLen = LineEnd + 1 - CursorX - Count; - if (MoveLen > 0) { memmove(&(CodeLine[CursorX+Count]), &(CodeLine[CursorX]), MoveLen); memmove(&(AttrLine[CursorX+Count]), &(AttrLine[CursorX]), MoveLen); @@ -591,15 +589,15 @@ memset(&(AttrLineFG[CursorX]), CurCharAttr.Fore, Count); memset(&(AttrLineBG[CursorX]), CurCharAttr.Back, Count); /* last char in current line is kanji first? */ - if ((AttrLine[LineEnd] & AttrKanji) != 0) { + if ((AttrLine[CursorRightM] & AttrKanji) != 0) { /* then delete it */ - CodeLine[LineEnd] = 0x20; - AttrLine[LineEnd] = AttrDefault; - AttrLine2[LineEnd] = CurCharAttr.Attr2; - AttrLineFG[LineEnd] = CurCharAttr.Fore; - AttrLineBG[LineEnd] = CurCharAttr.Back; + CodeLine[CursorRightM] = 0x20; + AttrLine[CursorRightM] = AttrDefault; + AttrLine2[CursorRightM] = CurCharAttr.Attr2; + AttrLineFG[CursorRightM] = CurCharAttr.Fore; + AttrLineBG[CursorRightM] = CurCharAttr.Back; } - BuffUpdateRect(CursorX, CursorY, LineEnd, CursorY); + BuffUpdateRect(CursorX, CursorY, CursorRightM, CursorY); } void BuffEraseCurToEnd()