+ added col info in MessageItem

+ grep uses HighLightExts and should work for linux
This commit is contained in:
pierre 1999-02-22 11:29:36 +00:00
parent 1ededfde9a
commit e10e79b38e
4 changed files with 59 additions and 22 deletions

View File

@ -139,9 +139,11 @@ begin
if (status.verbosity and Level)=Level then if (status.verbosity and Level)=Level then
{$endif} {$endif}
begin begin
ProgramInfoWindow^.AddMessage(Level,S,status.currentsourcepath+status.currentsource,status.currentline); ProgramInfoWindow^.AddMessage(Level,S,status.currentsourcepath+status.currentsource,
status.currentline,status.currentcolumn);
if SD<>nil then if SD<>nil then
SD^.MsgLB^.AddItem(New(PCompilerMessage, Init(Level, S, SmartPath(status.currentmodule),status.currentline))); SD^.MsgLB^.AddItem(New(PCompilerMessage, Init(Level, S, SmartPath(status.currentmodule),
status.currentline,status.currentcolumn)));
end; end;
{$ifdef TEMPHEAP} {$ifdef TEMPHEAP}
switch_to_temp_heap; switch_to_temp_heap;
@ -223,10 +225,13 @@ begin
do_stop:=CompilerStop; do_stop:=CompilerStop;
do_comment:=CompilerComment; do_comment:=CompilerComment;
{$ifdef go32v2} {$ifndef debug}
{ this avoids all flickers
and allows to get assembler and linker messages
but also forbids to use GDB inside !! }
ChangeRedir('fp$$$.out',false); ChangeRedir('fp$$$.out',false);
ChangeErrorRedir('fp$$$.err',false); ChangeErrorRedir('fp$$$.err',false);
{$endif def go32v2} {$endif ndef debug}
{$ifdef TEMPHEAP} {$ifdef TEMPHEAP}
split_heap; split_heap;
switch_to_temp_heap; switch_to_temp_heap;
@ -235,10 +240,8 @@ begin
{$ifdef TEMPHEAP} {$ifdef TEMPHEAP}
switch_to_base_heap; switch_to_base_heap;
{$endif TEMPHEAP} {$endif TEMPHEAP}
{$ifdef go32v2}
RestoreRedir; RestoreRedir;
RestoreErrorRedir; RestoreErrorRedir;
{$endif def go32v2}
if status.errorCount=0 if status.errorCount=0
then CompilationPhase:=cpDone then CompilationPhase:=cpDone
@ -269,7 +272,11 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.11 1999-02-08 09:31:00 florian Revision 1.12 1999-02-22 11:29:36 pierre
+ added col info in MessageItem
+ grep uses HighLightExts and should work for linux
Revision 1.11 1999/02/08 09:31:00 florian
+ some split heap stuff, in $ifdef TEMPHEAP + some split heap stuff, in $ifdef TEMPHEAP
Revision 1.10 1999/02/05 13:51:39 peter Revision 1.10 1999/02/05 13:51:39 peter

View File

@ -83,7 +83,9 @@ begin
Searchword:=PSourceWindow(DeskTop^.First)^.Editor^.GetCurrentWord Searchword:=PSourceWindow(DeskTop^.First)^.Editor^.GetCurrentWord
else else
Searchword:=''; Searchword:='';
GrepArgs:='-n -i $TEXT *.pas *.pp *.inc'; { add "" for args with spaces }
{ WARNING : text must still be entered in usual grep syntax }
GrepArgs:='-n -i "$TEXT" '+HighlightExts;
{ Dialog } { Dialog }
R.Assign(0,0,45,8); R.Assign(0,0,45,8);
new(PGrepDialog,Init(R,'Grep arguments')); new(PGrepDialog,Init(R,'Grep arguments'));
@ -144,7 +146,7 @@ begin
val(copy(Line,1,p-1),lineNb,error); val(copy(Line,1,p-1),lineNb,error);
if error=0 then if error=0 then
ProgramInfoWindow^.AddMessage(V_Normal,Copy(Line,p+1,255), ProgramInfoWindow^.AddMessage(V_Normal,Copy(Line,p+1,255),
ModuleName,LineNb); ModuleName,LineNb,1);
end; end;
ProgramInfoWindow^.Show; ProgramInfoWindow^.Show;
ProgramInfoWindow^.MakeFirst; ProgramInfoWindow^.MakeFirst;
@ -159,7 +161,11 @@ begin
end; end;
{ {
$Log$ $Log$
Revision 1.8 1999-02-22 02:15:17 peter Revision 1.9 1999-02-22 11:29:37 pierre
+ added col info in MessageItem
+ grep uses HighLightExts and should work for linux
Revision 1.8 1999/02/22 02:15:17 peter
+ default extension for save in the editor + default extension for save in the editor
+ Separate Text to Find for the grep dialog + Separate Text to Find for the grep dialog
* fixed redir crash with tp7 * fixed redir crash with tp7

View File

@ -199,8 +199,8 @@ type
TClass : longint; TClass : longint;
Text : PString; Text : PString;
Module : PString; Module : PString;
ID : longint; ID,Col : longint;
constructor Init(AClass: longint; AText, AModule: string; AID: longint); constructor Init(AClass: longint; AText, AModule: string; AID,ACol: longint);
function GetText(MaxLen: integer): string; virtual; function GetText(MaxLen: integer): string; virtual;
procedure Selected; virtual; procedure Selected; virtual;
function GetModuleName: string; virtual; function GetModuleName: string; virtual;
@ -234,7 +234,7 @@ type
InfoST: PColorStaticText; InfoST: PColorStaticText;
LogLB : PMessageListBox; LogLB : PMessageListBox;
constructor Init; constructor Init;
procedure AddMessage(AClass: longint; Msg, Module: string; Line: longint); procedure AddMessage(AClass: longint; Msg, Module: string; Line,Column: longint);
procedure SizeLimits(var Min, Max: TPoint); virtual; procedure SizeLimits(var Min, Max: TPoint); virtual;
procedure Close; virtual; procedure Close; virtual;
procedure HandleEvent(var Event: TEvent); virtual; procedure HandleEvent(var Event: TEvent); virtual;
@ -401,7 +401,11 @@ function EditorWindowFile(const Name : String): PSourceWindow;
function EditorWindow(P: PView): boolean; {$ifndef FPC}far;{$endif} function EditorWindow(P: PView): boolean; {$ifndef FPC}far;{$endif}
begin begin
EditorWindow:=(TypeOf(P^)=TypeOf(TSourceWindow)) and EditorWindow:=(TypeOf(P^)=TypeOf(TSourceWindow)) and
{$ifdef linux}
(PSourceWindow(P)^.Editor^.FileName=Name); (PSourceWindow(P)^.Editor^.FileName=Name);
{$else linux}
(UpCaseStr(PSourceWindow(P)^.Editor^.FileName)=UpCaseStr(Name));
{$endif def linux}
end; end;
begin begin
EditorWindowFile:=pointer(Desktop^.FirstThat(@EditorWindow)); EditorWindowFile:=pointer(Desktop^.FirstThat(@EditorWindow));
@ -2367,7 +2371,17 @@ begin
GetNextEditorBounds(R); GetNextEditorBounds(R);
if Assigned(Owner) and (Owner=pointer(ProgramInfoWindow)) then if Assigned(Owner) and (Owner=pointer(ProgramInfoWindow)) then
R.B.Y:=Owner^.Origin.Y; R.B.Y:=Owner^.Origin.Y;
W:=TryToOpenFile(@R,P^.GetModuleName,0,P^.ID-1); W:=EditorWindowFile(P^.GetModuleName);
if assigned(W) then
begin
W^.GetExtent(R);
if Assigned(Owner) and (Owner=pointer(ProgramInfoWindow)) then
R.B.Y:=Owner^.Origin.Y;
W^.ChangeBounds(R);
W^.Editor^.SetCurPtr(P^.Col-1,P^.ID-1);
end
else
W:=TryToOpenFile(@R,P^.GetModuleName,P^.Col-1,P^.ID-1);
if W<>nil then if W<>nil then
begin begin
W^.Select; W^.Select;
@ -2386,7 +2400,7 @@ begin
P:=List^.At(Focused); P:=List^.At(Focused);
if P^.ID=0 then Exit; if P^.ID=0 then Exit;
Desktop^.Lock; Desktop^.Lock;
W:=TryToOpenFile(nil,P^.GetModuleName,0,P^.ID-1); W:=TryToOpenFile(nil,P^.GetModuleName,P^.Col-1,P^.ID-1);
Message(Owner,evCommand,cmClose,nil); Message(Owner,evCommand,cmClose,nil);
Desktop^.UnLock; Desktop^.UnLock;
end; end;
@ -2467,13 +2481,14 @@ begin
if List<>nil then Dispose(List, Done); if List<>nil then Dispose(List, Done);
end; end;
constructor TMessageItem.Init(AClass: longint; AText, AModule: string; AID: longint); constructor TMessageItem.Init(AClass: longint; AText, AModule: string; AID,ACol: longint);
begin begin
inherited Init; inherited Init;
TClass:=AClass; TClass:=AClass;
Text:=NewStr(AText); Text:=NewStr(AText);
Module:=NewStr(AModule); Module:=NewStr(AModule);
ID:=AID; ID:=AID;
Col:=ACol;
end; end;
function TMessageItem.GetText(MaxLen: integer): string; function TMessageItem.GetText(MaxLen: integer): string;
@ -2562,10 +2577,10 @@ begin
Update; Update;
end; end;
procedure TProgramInfoWindow.AddMessage(AClass: longint; Msg, Module: string; Line: longint); procedure TProgramInfoWindow.AddMessage(AClass: longint; Msg, Module: string; Line,Column: longint);
begin begin
if AClass>=V_Info then Line:=0; if AClass>=V_Info then Line:=0;
LogLB^.AddItem(New(PCompilerMessage, Init(AClass, Msg, Module, Line))); LogLB^.AddItem(New(PCompilerMessage, Init(AClass, Msg, Module, Line,Column)));
end; end;
procedure TProgramInfoWindow.SizeLimits(var Min, Max: TPoint); procedure TProgramInfoWindow.SizeLimits(var Min, Max: TPoint);
@ -3269,7 +3284,11 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.17 1999-02-22 02:15:22 peter Revision 1.18 1999-02-22 11:29:38 pierre
+ added col info in MessageItem
+ grep uses HighLightExts and should work for linux
Revision 1.17 1999/02/22 02:15:22 peter
+ default extension for save in the editor + default extension for save in the editor
+ Separate Text to Find for the grep dialog + Separate Text to Find for the grep dialog
* fixed redir crash with tp7 * fixed redir crash with tp7

View File

@ -1,3 +1,4 @@
{$L+}
unit Test2; unit Test2;
interface interface
@ -21,4 +22,8 @@ begin
IsOdd:=(X mod 2)=1; IsOdd:=(X mod 2)=1;
end; end;
procedure static;
begin
end;
END. END.