mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 03:30:30 +02:00
* forgot CommentLineType check to see if we need to update format
on next line * some changes for TEST_PARTIAL_SYNTAX still does notwork :(
This commit is contained in:
parent
a21f1faefb
commit
ca58f7d947
@ -17,7 +17,7 @@
|
|||||||
unit WEditor;
|
unit WEditor;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
{$tes}
|
||||||
uses
|
uses
|
||||||
Dos,Objects,Drivers,Views,Menus,Commands,
|
Dos,Objects,Drivers,Views,Menus,Commands,
|
||||||
WUtils;
|
WUtils;
|
||||||
@ -165,7 +165,7 @@ type
|
|||||||
EndsWithComment : boolean;
|
EndsWithComment : boolean;
|
||||||
BeginsWithDirective,
|
BeginsWithDirective,
|
||||||
EndsWithDirective : boolean;
|
EndsWithDirective : boolean;
|
||||||
{BeginCommentType,}EndCommentType : byte;
|
BeginCommentType,EndCommentType : byte;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
PLineCollection = ^TLineCollection;
|
PLineCollection = ^TLineCollection;
|
||||||
@ -4280,11 +4280,6 @@ var
|
|||||||
var CurLine: Sw_integer;
|
var CurLine: Sw_integer;
|
||||||
Line,NextLine,PrevLine,OldLine: PLine;
|
Line,NextLine,PrevLine,OldLine: PLine;
|
||||||
begin
|
begin
|
||||||
{$ifdef TEST_PARTIAL_SYNTAX}
|
|
||||||
If ((Flags and efSyntaxHighlight)<>0) and (LastSyntaxedLine<FromLine)
|
|
||||||
and (FromLine<GetLineCount) then
|
|
||||||
FromLine:=UpdateAttrsRange(LastSyntaxedLine,FromLine,Attrs);
|
|
||||||
{$endif TEST_PARTIAL_SYNTAX}
|
|
||||||
if ((Flags and efSyntaxHighlight)=0) or (FromLine>=GetLineCount) then
|
if ((Flags and efSyntaxHighlight)=0) or (FromLine>=GetLineCount) then
|
||||||
begin
|
begin
|
||||||
SetLineFormat(FromLine,'');
|
SetLineFormat(FromLine,'');
|
||||||
@ -4296,7 +4291,13 @@ begin
|
|||||||
UpdateIndicator;
|
UpdateIndicator;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
CurLine:=FromLine;
|
{$ifdef TEST_PARTIAL_SYNTAX}
|
||||||
|
If ((Flags and efSyntaxHighlight)<>0) and (LastSyntaxedLine<FromLine)
|
||||||
|
and (FromLine<GetLineCount) then
|
||||||
|
CurLine:=LastSyntaxedLine
|
||||||
|
else
|
||||||
|
{$endif TEST_PARTIAL_SYNTAX}
|
||||||
|
CurLine:=FromLine;
|
||||||
if CurLine>0 then PrevLine:=Lines^.At(CurLine-1) else PrevLine:=nil;
|
if CurLine>0 then PrevLine:=Lines^.At(CurLine-1) else PrevLine:=nil;
|
||||||
repeat
|
repeat
|
||||||
Line:=Lines^.At(CurLine);
|
Line:=Lines^.At(CurLine);
|
||||||
@ -4319,6 +4320,7 @@ begin
|
|||||||
Line^.BeginsWithAsm:=InAsm;
|
Line^.BeginsWithAsm:=InAsm;
|
||||||
Line^.BeginsWithComment:=InComment;
|
Line^.BeginsWithComment:=InComment;
|
||||||
Line^.BeginsWithDirective:=InDirective;
|
Line^.BeginsWithDirective:=InDirective;
|
||||||
|
Line^.BeginCommentType:=CurrentCommentType;
|
||||||
LineText:=GetLineText(CurLine);
|
LineText:=GetLineText(CurLine);
|
||||||
Format:=CharStr(chr(coTextColor),length(LineText));
|
Format:=CharStr(chr(coTextColor),length(LineText));
|
||||||
LastCC:=ccWhiteSpace;
|
LastCC:=ccWhiteSpace;
|
||||||
@ -4351,16 +4353,28 @@ begin
|
|||||||
(OldLine^.EndsWithComment=Line^.EndsWithComment) and
|
(OldLine^.EndsWithComment=Line^.EndsWithComment) and
|
||||||
(OldLine^.EndsWithAsm=Line^.EndsWithAsm) and
|
(OldLine^.EndsWithAsm=Line^.EndsWithAsm) and
|
||||||
(OldLine^.EndsWithDirective=Line^.EndsWithDirective) and }
|
(OldLine^.EndsWithDirective=Line^.EndsWithDirective) and }
|
||||||
|
{$ifdef TEST_PARTIAL_SYNTAX}
|
||||||
|
(CurLine>=FromLine) and
|
||||||
|
{$endif TEST_PARTIAL_SYNTAX}
|
||||||
(NextLine^.BeginsWithAsm=Line^.EndsWithAsm) and
|
(NextLine^.BeginsWithAsm=Line^.EndsWithAsm) and
|
||||||
(NextLine^.BeginsWithComment=Line^.EndsWithComment) and
|
(NextLine^.BeginsWithComment=Line^.EndsWithComment) and
|
||||||
(NextLine^.BeginsWithDirective=Line^.EndsWithDirective) and
|
(NextLine^.BeginsWithDirective=Line^.EndsWithDirective) and
|
||||||
|
(NextLine^.BeginCommentType=Line^.EndCommentType) and
|
||||||
(NextLine^.Format<>nil) then
|
(NextLine^.Format<>nil) then
|
||||||
Break;
|
Break;
|
||||||
{$ifdef TEST_PARTIAL_SYNTAX}
|
{$ifdef TEST_PARTIAL_SYNTAX}
|
||||||
if not SyntaxComplete then
|
if (CurLine<GetLineCount ) and
|
||||||
if ((Attrs and attrForceFull)=0) and
|
((Attrs and attrForceFull)=0) and
|
||||||
(CurLine>Delta.Y+Size.Y) then
|
(CurLine>Delta.Y+Size.Y) then
|
||||||
|
begin
|
||||||
|
If SyntaxComplete then
|
||||||
|
begin
|
||||||
|
SyntaxComplete:=false;
|
||||||
|
UpdateIndicator;
|
||||||
|
end;
|
||||||
|
LastSyntaxedLine:=CurLine-1;
|
||||||
break;
|
break;
|
||||||
|
end;
|
||||||
{$endif TEST_PARTIAL_SYNTAX}
|
{$endif TEST_PARTIAL_SYNTAX}
|
||||||
PrevLine:=Line;
|
PrevLine:=Line;
|
||||||
until false;
|
until false;
|
||||||
@ -5482,7 +5496,12 @@ end;
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.71 2000-01-06 17:47:26 pierre
|
Revision 1.72 2000-01-07 00:19:30 pierre
|
||||||
|
* forgot CommentLineType check to see if we need to update format
|
||||||
|
on next line
|
||||||
|
* some changes for TEST_PARTIAL_SYNTAX still does notwork :(
|
||||||
|
|
||||||
|
Revision 1.71 2000/01/06 17:47:26 pierre
|
||||||
* avoid to resyntax whole source in unnecessary cases
|
* avoid to resyntax whole source in unnecessary cases
|
||||||
|
|
||||||
Revision 1.70 2000/01/05 17:35:50 pierre
|
Revision 1.70 2000/01/05 17:35:50 pierre
|
||||||
|
Loading…
Reference in New Issue
Block a user