Fixed another bug (I had fixed it once but removed the fix accidentally)

This commit is contained in:
Christian Hammacher 2005-11-02 14:17:00 +00:00
parent 8016d02319
commit efe4b674e2
5 changed files with 23 additions and 32 deletions

View File

@ -115,7 +115,7 @@ AutoIncBuild=1
MajorVer=1 MajorVer=1
MinorVer=3 MinorVer=3
Release=0 Release=0
Build=12 Build=14
Debug=0 Debug=0
PreRelease=0 PreRelease=0
Special=0 Special=0
@ -126,7 +126,7 @@ CodePage=1252
[Version Info Keys] [Version Info Keys]
CompanyName=AMX Mod X Dev Team CompanyName=AMX Mod X Dev Team
FileDescription= FileDescription=
FileVersion=1.3.0.12 FileVersion=1.3.0.14
InternalName= InternalName=
LegalCopyright= LegalCopyright=
LegalTrademarks= LegalTrademarks=

Binary file not shown.

Binary file not shown.

View File

@ -54,6 +54,7 @@ var eCILine: Integer;
FItems: TObjectList; FItems: TObjectList;
STLItem: TSelectionTextList; STLItem: TSelectionTextList;
eStock: Boolean; eStock: Boolean;
eUpdating: Boolean;
implementation implementation
@ -371,12 +372,15 @@ end;
procedure UpdateCI(eLine: Integer); procedure UpdateCI(eLine: Integer);
begin begin
if eUpdating then exit;
eUpdating := True;
if not Plugin_UpdateCodeInspector(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, True) then exit; if not Plugin_UpdateCodeInspector(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, True) then exit;
if GetCurrLang.Name = 'Pawn' then begin if GetCurrLang.Name = 'Pawn' then begin
UpdateCI_Pawn(eLine); UpdateCI_Pawn(eLine);
Plugin_UpdateCodeInspector(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, False); Plugin_UpdateCodeInspector(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, False);
end; end;
eUpdating := False;
end; end;
procedure UpdateCI_Pawn(eLine: Integer); procedure UpdateCI_Pawn(eLine: Integer);
@ -387,6 +391,7 @@ var eCurrLine, eBackupLine: string;
eVarCount, eConstCount: Integer; eVarCount, eConstCount: Integer;
eFound: Boolean; eFound: Boolean;
begin begin
eCILine := eLine;
eBackupLine := frmMain.sciEditor.Lines[eLine]; eBackupLine := frmMain.sciEditor.Lines[eLine];
// Prevent parse errors // Prevent parse errors
eBackupLine := StringReplace(eBackupLine, #1, '', [rfReplaceAll]); eBackupLine := StringReplace(eBackupLine, #1, '', [rfReplaceAll]);
@ -576,9 +581,7 @@ begin
eStr.Free; eStr.Free;
frmMain.jviCode.EndUpdate; frmMain.jviCode.EndUpdate;
if eLine <> eCILine then if eLine <> eCILine then
UpdateCI_Pawn(eLine) UpdateCI_Pawn(eLine);
else
eCILine := -1;
exit; exit;
end; end;
{ Return } { Return }
@ -598,9 +601,7 @@ begin
eStr.Free; eStr.Free;
frmMain.jviCode.EndUpdate; frmMain.jviCode.EndUpdate;
if eLine <> eCILine then if eLine <> eCILine then
UpdateCI_Pawn(eLine) UpdateCI_Pawn(eLine);
else
eCILine := -1;
exit; exit;
end; end;
{ For-Loop } { For-Loop }
@ -639,9 +640,7 @@ begin
eStr.Free; eStr.Free;
frmMain.jviCode.EndUpdate; frmMain.jviCode.EndUpdate;
if eLine <> eCILine then if eLine <> eCILine then
UpdateCI_Pawn(eLine) UpdateCI_Pawn(eLine);
else
eCILine := -1;
exit; exit;
end; end;
{ While-Loops } { While-Loops }
@ -689,9 +688,7 @@ begin
eStr.Free; eStr.Free;
frmMain.jviCode.EndUpdate; frmMain.jviCode.EndUpdate;
if eLine <> eCILine then if eLine <> eCILine then
UpdateCI_Pawn(eLine) UpdateCI_Pawn(eLine);
else
eCILine := -1;
exit; exit;
end; end;
@ -779,9 +776,7 @@ begin
eStr.Free; eStr.Free;
frmMain.jviCode.EndUpdate; frmMain.jviCode.EndUpdate;
if eLine <> eCILine then if eLine <> eCILine then
UpdateCI_Pawn(eLine) UpdateCI_Pawn(eLine);
else
eCILine := -1;
exit; exit;
end end
else if (Pos('(', eCurrLine) <> Pos(')', eCurrLine)) and (Assignment(eBackupLine) = '') then begin // Function Call else if (Pos('(', eCurrLine) <> Pos(')', eCurrLine)) and (Assignment(eBackupLine) = '') then begin // Function Call
@ -896,9 +891,7 @@ begin
eStr2.Free; eStr2.Free;
frmMain.jviCode.EndUpdate; frmMain.jviCode.EndUpdate;
if eLine <> eCILine then if eLine <> eCILine then
UpdateCI_Pawn(eLine) UpdateCI_Pawn(eLine);
else
eCILine := -1;
exit; exit;
end end
{ Assignment } { Assignment }
@ -922,9 +915,7 @@ begin
eStr.Free; eStr.Free;
frmMain.jviCode.EndUpdate; frmMain.jviCode.EndUpdate;
if eLine <> eCILine then if eLine <> eCILine then
UpdateCI_Pawn(eLine) UpdateCI_Pawn(eLine);
else
eCILine := -1;
exit; exit;
end; end;
@ -934,9 +925,7 @@ begin
frmMain.jviCode.EndUpdate; frmMain.jviCode.EndUpdate;
if eLine <> eCILine then if eLine <> eCILine then
UpdateCI_Pawn(eLine) UpdateCI_Pawn(eLine);
else
eCILine := -1;
end; end;
{ TSTLWrapper } { TSTLWrapper }
@ -1153,7 +1142,8 @@ begin
if Trim(eLine) <> '' then if Trim(eLine) <> '' then
frmMain.sciEditor.Lines[eCILine] := eLine; frmMain.sciEditor.Lines[eCILine] := eLine;
// UpdateCI(eCILine); frmMain.mnuModified.Caption := lModified;
ActiveDoc.Modified := True;
end; end;
initialization initialization

View File

@ -2847,18 +2847,19 @@ end;
procedure TfrmMain.trvExplorerClick(Sender: TObject); procedure TfrmMain.trvExplorerClick(Sender: TObject);
begin begin
if Assigned(trvExplorer.Selected) then if Assigned(trvExplorer.Selected) then begin
if trvExplorer.Selected.ImageIndex >= 42 then exit;
UpdateCI(Integer(trvExplorer.Selected.Data)); UpdateCI(Integer(trvExplorer.Selected.Data));
end; end;
end;
procedure TfrmMain.jviCodeItemValueChanged(Sender: TObject; procedure TfrmMain.jviCodeItemValueChanged(Sender: TObject;
Item: TJvCustomInspectorItem); Item: TJvCustomInspectorItem);
begin begin
if GetCurrLang.Name = 'Pawn' then begin if GetCurrLang.Name = 'Pawn' then
eCILine := sciEditor.GetCurrentLineNumber;
RebuildLine; RebuildLine;
end; end;
end;
procedure TfrmMain.mnuRestoreBackupClick(Sender: TObject); procedure TfrmMain.mnuRestoreBackupClick(Sender: TObject);
begin begin