parent
f317fb4c0c
commit
28e5c5b476
|
|
@ -1672,7 +1672,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
ci++;
|
ci++;
|
||||||
break;
|
break;
|
||||||
end }
|
end }
|
||||||
if ivi=0xa1 or ivi=0xa3 then //处理中文符号
|
if if_c_sym(s,cx,ls,lx) then //处理中文符号
|
||||||
begin
|
begin
|
||||||
cx++;
|
cx++;
|
||||||
ci--;
|
ci--;
|
||||||
|
|
@ -1705,7 +1705,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
|
||||||
//ivi := ord(vi);
|
//ivi := ord(vi);
|
||||||
ivi := getchar(s,cx);
|
ivi := getchar(s,cx);
|
||||||
//if (ivi<=0x2f) or (ivi>122 and ivi<=127) then break;
|
//if (ivi<=0x2f) or (ivi>122 and ivi<=127) then break;
|
||||||
if ivi=0xa1 or ivi=0xa3 then //处理中文符号
|
if if_c_sym(s,cx,ls) then //处理中文符号
|
||||||
begin
|
begin
|
||||||
break;
|
break;
|
||||||
end
|
end
|
||||||
|
|
@ -3045,13 +3045,21 @@ type TSynHighLighter = class(TComponent) //
|
||||||
begin
|
begin
|
||||||
SetTToken(tks,ctk,idx-1);
|
SetTToken(tks,ctk,idx-1);
|
||||||
end else
|
end else
|
||||||
if idx<len and( ord(vi)=0xa3 or ord(vi)=0xa1) then
|
if if_c_sym(s,idx,len) then
|
||||||
begin
|
begin
|
||||||
SetTToken(tks,ctk,idx-1);
|
SetTToken(tks,ctk,idx-1);
|
||||||
ctk := s[idx:(idx+1)];
|
ctk := s[idx:(idx+1)];
|
||||||
idx++;
|
idx++;
|
||||||
SetTToken(tks,ctk,idx);
|
SetTToken(tks,ctk,idx);
|
||||||
end
|
end
|
||||||
|
{else
|
||||||
|
if idx<len and( ord(vi)=0xa3 or ord(vi)=0xa1) then
|
||||||
|
begin
|
||||||
|
SetTToken(tks,ctk,idx-1);
|
||||||
|
ctk := s[idx:(idx+1)];
|
||||||
|
idx++;
|
||||||
|
SetTToken(tks,ctk,idx);
|
||||||
|
end }
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
ctk+=vi;
|
ctk+=vi;
|
||||||
|
|
@ -4301,6 +4309,31 @@ type TSynMemoNorm = class(TsynCustomMemo) //
|
||||||
FSheetTabFlage;
|
FSheetTabFlage;
|
||||||
end
|
end
|
||||||
Implementation
|
Implementation
|
||||||
|
function if_c_sym(s,idx,len,lx);//是否为中文符号
|
||||||
|
begin
|
||||||
|
if lx then //倒序
|
||||||
|
begin
|
||||||
|
if not(idx<=len) then return 0;
|
||||||
|
if idx<2 then return 0;
|
||||||
|
c1 := getchar(s,idx-1);
|
||||||
|
if not(c1 .& 0xa0) then return 0;
|
||||||
|
c2 := getchar(s,idx);
|
||||||
|
end else //正序
|
||||||
|
begin
|
||||||
|
if not(idx<len ) then return 0;
|
||||||
|
c1 := getchar(s,idx);
|
||||||
|
if not(c1 .& 0xa0) then return 0;
|
||||||
|
c2 := getchar(s,idx+1);
|
||||||
|
end
|
||||||
|
symv := static array(161,162,163,161,163,164,163,168,163,169,161,164,161,190,161,191,163,186,161,176,161,177,161,174,163,187,161,163,163,172);
|
||||||
|
for i:=0 to length(symv)-1 step 2 do
|
||||||
|
begin
|
||||||
|
if c1=symv[i] and c2=symv[i+1] then
|
||||||
|
begin
|
||||||
|
return 1;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function CreateATslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode);
|
function CreateATslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode);
|
||||||
begin
|
begin
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue