更新
1.优化gtk滚动 2.优化文件查找返回结果
This commit is contained in:
@@ -3849,6 +3849,47 @@ type TEditer=class(TCustomcontrol) //
|
||||
linesi := array(1:1);
|
||||
if (1 = readfile(rwraw(),"",f,0,filesize("",f),s)) and s then
|
||||
begin
|
||||
strcode := 0;
|
||||
if(length(s)>= 2)and ord(s[1])=0xFE and ord(s[2])=0xFF then //ucs2-big
|
||||
begin
|
||||
strcode := 1;
|
||||
if length(s)=2 then s := "";
|
||||
else
|
||||
begin
|
||||
s1 := "";
|
||||
setlength(s1,length(s)-2);
|
||||
for i := 3 to length(s)-1 step 2 do
|
||||
begin
|
||||
s1[i-2]:= s[i+1];
|
||||
s1[i-1]:= s[i];
|
||||
end
|
||||
s := unicodetomultibyte(s1,936);
|
||||
end
|
||||
end else
|
||||
if(length(s)>= 2)and ord(s[1])=0xFF and ord(s[2])=0xFE then //ucs2-little
|
||||
begin
|
||||
strcode := 1;
|
||||
if length(s)=2 then s := "";
|
||||
else
|
||||
begin
|
||||
s := unicodetomultibyte(s[3:],936);
|
||||
end
|
||||
end else
|
||||
if(length(s)>= 3)and ord(s[1])=0xEF and ord(s[2])=0xBB and ord(s[3])=0xBF then
|
||||
begin
|
||||
strcode := 1;
|
||||
if length(s)=3 then s := "";
|
||||
else s := utf8toansi(s[4:]);
|
||||
end
|
||||
if(0=strcode)then
|
||||
begin
|
||||
if IsTextUTF8(s)=1 then
|
||||
begin
|
||||
s := utf8toansi(s);
|
||||
end
|
||||
end
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
slen := length(s);
|
||||
if 1= parseregexpr(ctl,s,ctl2,m,mp,mlen) then
|
||||
begin
|
||||
r := array();
|
||||
@@ -3861,9 +3902,12 @@ type TEditer=class(TCustomcontrol) //
|
||||
fgf := "\n";
|
||||
end else
|
||||
fgf := "\r";
|
||||
p1 := 1;
|
||||
p2 := 0;
|
||||
for i,v in m do
|
||||
begin
|
||||
mi := mp[i,0];
|
||||
|
||||
while idx<mi do
|
||||
begin
|
||||
vi := s[idx];
|
||||
@@ -3876,12 +3920,24 @@ type TEditer=class(TCustomcontrol) //
|
||||
jid := 1;
|
||||
end
|
||||
end
|
||||
|
||||
r[i][0] := rid; //行
|
||||
r[i][1] := jid; //列
|
||||
p1 := linesi[rid-1];
|
||||
p2 := idx+mlen[i,0]-1;
|
||||
if (p2>p1) and (rid<>orid) then
|
||||
begin
|
||||
begin
|
||||
isset := 1;
|
||||
for ii := p2 to slen do
|
||||
begin
|
||||
if s[ii]=fgf then
|
||||
begin
|
||||
isset := 0;
|
||||
p2 := ii;
|
||||
break;
|
||||
end
|
||||
end
|
||||
if isset then p2 := slen;
|
||||
r[i][2] := trim(s[p1:p2]);
|
||||
end
|
||||
else r[i,2] := "";
|
||||
|
||||
Reference in New Issue
Block a user