From 28e5c5b476feda4894d7e7b69ea268d16584188b Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Tue, 5 Sep 2023 09:39:44 +0800 Subject: [PATCH] Update utslmemo.tsf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正中文符号选取问题 --- funcext/tvclib/utslmemo.tsf | 49 +++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/funcext/tvclib/utslmemo.tsf b/funcext/tvclib/utslmemo.tsf index 7617406..b0768d7 100644 --- a/funcext/tvclib/utslmemo.tsf +++ b/funcext/tvclib/utslmemo.tsf @@ -1672,12 +1672,12 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) // ci++; break; end } - if ivi=0xa1 or ivi=0xa3 then //ķ - begin + if if_c_sym(s,cx,ls,lx) then //ķ + begin cx++; ci--; - break; - end + break; + end if(ivi<48)or(ivi>57 and ivi<65)or(ivi>90 and ivi<95)or(ivi>95 and ivi<97)or(ivi>122 and ivi <= 127)then begin ci++; @@ -1705,9 +1705,9 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) // //ivi := ord(vi); ivi := getchar(s,cx); //if (ivi<=0x2f) or (ivi>122 and ivi<=127) then break; - if ivi=0xa1 or ivi=0xa3 then //ķ - begin - break; + if if_c_sym(s,cx,ls) then //ķ + begin + break; end if(ivi<48)or(ivi>57 and ivi<65)or(ivi>90 and ivi<95)or(ivi>95 and ivi<97)or(ivi>122 and ivi <= 127)then break; ci++; @@ -3045,13 +3045,21 @@ type TSynHighLighter = class(TComponent) // begin SetTToken(tks,ctk,idx-1); end else + if if_c_sym(s,idx,len) then + begin + SetTToken(tks,ctk,idx-1); + ctk := s[idx:(idx+1)]; + idx++; + SetTToken(tks,ctk,idx); + end + {else if idx