Revision: 7960 https://osdn.net/projects/ttssh2/scm/svn/commits/7960 Author: zmatsuo Date: 2019-08-15 23:01:28 +0900 (Thu, 15 Aug 2019) Log Message: ----------- 範囲選択時の描画がうまくできていなかったので修正 Modified Paths: -------------- branches/unicode_buf/teraterm/teraterm/buffer.c -------------- next part -------------- Modified: branches/unicode_buf/teraterm/teraterm/buffer.c =================================================================== --- branches/unicode_buf/teraterm/teraterm/buffer.c 2019-08-15 12:15:12 UTC (rev 7959) +++ branches/unicode_buf/teraterm/teraterm/buffer.c 2019-08-15 14:01:28 UTC (rev 7960) @@ -193,12 +193,12 @@ // UTF-32 p->u32_last = u32; - p->pCombinationChars32[p->CombinationCharCount32] = u32; + p->pCombinationChars32[(size_t)p->CombinationCharCount32] = u32; p->CombinationCharCount32++; // UTF-16 { - wchar_t *u16 = &p->pCombinationChars16[p->CombinationCharCount16]; + wchar_t *u16 = &p->pCombinationChars16[(size_t)p->CombinationCharCount16]; size_t wlen = UTF32ToUTF16(u32, u16, 2); p->CombinationCharCount16 += (char)wlen; } @@ -240,7 +240,7 @@ } #endif -LONG GetLinePtr(int Line) +static LONG GetLinePtr(int Line) { LONG Ptr; @@ -251,7 +251,7 @@ return Ptr; } -LONG NextLinePtr(LONG Ptr) +static LONG NextLinePtr(LONG Ptr) { Ptr = Ptr + (LONG)NumOfColumns; if (Ptr >= BufferSize) { @@ -260,7 +260,7 @@ return Ptr; } -LONG PrevLinePtr(LONG Ptr) +static LONG PrevLinePtr(LONG Ptr) { Ptr = Ptr - (LONG)NumOfColumns; if (Ptr < 0) { @@ -2582,7 +2582,6 @@ const buff_char_t *b; TCharAttr TempAttr; BOOL DrawFlag = FALSE; - BOOL Conbination = FALSE; // \x83A\x83g\x83\x8A\x83r\x83\x85\x81[\x83g\x8E擾 TempAttr.Attr = AttrBuff[TmpPtr+istart+count] & ~ AttrKanji; @@ -2594,9 +2593,6 @@ lenA++; b = &CodeBuffW[TmpPtr + istart + count]; - if (b->u32 == 0x1a1) { - int a = 0; - } if (b->u32 == 0) { // \x91S\x8Ap\x82̎\x9F\x82̕\xB6\x8E\x9A,\x8F\x88\x97\x9D\x95s\x97v } else { @@ -2612,7 +2608,6 @@ bufW[lenW] = b->wc2[1]; bufWW[lenW] = '0'; lenW++; - Conbination = TRUE; DrawFlag = TRUE; // \x82\xB7\x82\xAE\x82ɕ`\x89悷\x82\xE9 } if ((b->WidthProperty == 'W' || b->WidthProperty == 'H') && @@ -2625,7 +2620,6 @@ bufWW[lenW + i] = '0'; } lenW += b->CombinationCharCount16; - Conbination = TRUE; DrawFlag = TRUE; // \x83R\x83\x93\x83r\x83l\x81[\x83V\x83\x87\x83\x93\x82\xAA\x82\xA0\x82\xE9\x8Fꍇ\x82͂\xB7\x82\xAE\x95`\x89\xE6 } } @@ -2634,27 +2628,20 @@ // \x8Dŏ\x89\x82\xCC1\x95\xB6\x8E\x9A\x96\xDA CurAttr = TempAttr; CurSelected = CheckSelect(istart+count,SY); + } else if (b->u32 != 0 && + ((TCharAttrCmp(CurAttr, TempAttr) != 0) || + (CurSelected != CheckSelect(istart+count,SY)))) { + // \x82\xB1\x82̕\xB6\x8E\x9A\x82ŃA\x83g\x83\x8A\x83r\x83\x85\x81[\x83g\x82\xAA\x95ω\xBB\x82\xB5\x82\xBD \x81\xA8 \x95`\x89\xE6 + DrawFlag = TRUE; + lenA--; + lenW--; + count--; } + // \x8DŌ\xE3\x82܂ŃX\x83L\x83\x83\x83\x93\x82\xB5\x82\xBD? if (istart + count >= IEnd) { - // \x8DŌ\xE3\x82܂ŃX\x83L\x83\x83\x83\x93\x82\xB5\x82\xBD DrawFlag = TRUE; EndFlag = TRUE; - } else if (DrawFlag) { - ; - } else if (b->u32 == 0 || count == 0) { - // \x83A\x83g\x83\x8A\x83r\x83\x85\x81[\x83g\x82̃`\x83F\x83b\x83N\x95s\x97v - } else { - // \x82\xB1\x82̕\xB6\x8E\x9A\x82ŃA\x83g\x83\x8A\x83r\x83\x85\x81[\x83g\x82\xAA\x95ω\xBB\x82\xB7\x82\xE9? - if ((TCharAttrCmp(CurAttr, TempAttr) != 0) || - (CurSelected != CheckSelect(istart+count,SY))) - { - // \x83A\x83g\x83\x8A\x83r\x83\x85\x81[\x83g\x82\xAA\x95ω\xBB\x82\xB5\x82\xBD - DrawFlag = TRUE; - lenA--; - lenW--; - count--; - } } if (DrawFlag) {