* text insertion in middle of line was buggy

This commit is contained in:
pierre 1999-09-28 23:44:13 +00:00
parent c2b91fcf40
commit d2e4e3630e

View File

@ -3587,8 +3587,8 @@ var OK: boolean;
LineDelta,LineCount: Sw_integer; LineDelta,LineCount: Sw_integer;
StartPos,DestPos: TPoint; StartPos,DestPos: TPoint;
LineStartX,LineEndX: Sw_integer; LineStartX,LineEndX: Sw_integer;
S,OrigS: string; S,OrigS,AfterS: string;
VerticalBlock: boolean; OneLineOnly,VerticalBlock: boolean;
SEnd: TPoint; SEnd: TPoint;
begin begin
Lock; Lock;
@ -3626,8 +3626,17 @@ begin
Min(LineEndX-LineStartX+1,255)); Min(LineEndX-LineStartX+1,255));
if VerticalBlock=false then if VerticalBlock=false then
begin begin
OrigS:=GetDisplayText(DestPos.Y); If LineDelta=0 then
SetLineText(DestPos.Y,RExpand(copy(OrigS,1,DestPos.X),DestPos.X)+S+copy(OrigS,DestPos.X+1,255)); begin
OrigS:=GetDisplayText(DestPos.Y);
AfterS:=Copy(OrigS,DestPos.X+1,255);
end
else
OrigS:='';
if LineDelta=LineCount-1 then
SetLineText(DestPos.Y,RExpand(copy(OrigS,1,DestPos.X),DestPos.X)+S+AfterS)
else
SetLineText(DestPos.Y,RExpand(copy(OrigS,1,DestPos.X),DestPos.X)+S);
if LineDelta=LineCount-1 then if LineDelta=LineCount-1 then
begin begin
SEnd.Y:=DestPos.Y; SEnd.Y:=DestPos.Y;
@ -3640,7 +3649,10 @@ begin
end; end;
end end
else { if VerticalBlock=false then .. else } else { if VerticalBlock=false then .. else }
S:=RExpand(S,LineEndX-LineStartX+1); begin
{ this is not yet implemented !! PM }
S:=RExpand(S,LineEndX-LineStartX+1);
end;
Inc(LineDelta); Inc(LineDelta);
OK:=GetLineCount<MaxLineCount; OK:=GetLineCount<MaxLineCount;
end; end;
@ -4465,7 +4477,10 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.49 1999-09-23 16:33:30 pierre Revision 1.50 1999-09-28 23:44:13 pierre
* text insertion in middle of line was buggy
Revision 1.49 1999/09/23 16:33:30 pierre
* ^B^A now prints out the ascii 1 char * ^B^A now prints out the ascii 1 char
* In SearchReplace Several occurence of a pattern in the same line * In SearchReplace Several occurence of a pattern in the same line
should now be found correctly should now be found correctly