Fixed small bug in the indent function
This commit is contained in:
parent
4165548661
commit
32fd0f9e93
@ -115,7 +115,7 @@ AutoIncBuild=1
|
||||
MajorVer=1
|
||||
MinorVer=3
|
||||
Release=0
|
||||
Build=28
|
||||
Build=29
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
@ -126,7 +126,7 @@ CodePage=1252
|
||||
[Version Info Keys]
|
||||
CompanyName=AMX Mod X Dev Team
|
||||
FileDescription=
|
||||
FileVersion=1.3.0.28
|
||||
FileVersion=1.3.0.29
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
|
Binary file not shown.
Binary file not shown.
@ -143,6 +143,7 @@ begin
|
||||
frmMain.pbLoading.Position := i;
|
||||
SetProgressStatus('Indenting Code...');
|
||||
eStr[i] := RemoveStringsAndComments(eStr[i], True, True);
|
||||
eStr[i] := LowerCase(Trim(eStr[i]));
|
||||
end;
|
||||
|
||||
for i := 0 to eStr.Count -1 do begin
|
||||
@ -173,15 +174,8 @@ begin
|
||||
eTempIndent := eTempIndent +1;
|
||||
end;
|
||||
end
|
||||
else if (IsAtStart('else', eStr[i], False)) and (Pos('{', eStr[i]) = 0) then begin
|
||||
eString := eStr[i];
|
||||
Delete(eString, 1, 4);
|
||||
if eString[1] <> Trim(eString)[1] then begin
|
||||
eString := Trim(eString);
|
||||
if GetMatchingBrace(eString) = Length(eString) then
|
||||
eTempIndent := eTempIndent +1;
|
||||
end;
|
||||
end
|
||||
else if (eStr[i] = 'else') or (Pos('else if', eStr[i]) = 1) and (Pos('{', eStr[i]) = 0) then
|
||||
eTempIndent := eTempIndent +1
|
||||
else if (Pos('{', eStr[i]) = 0) and (Length(eStr[i]) > 6) then begin
|
||||
if (IsAtStart('stock', eStr[i], False)) or (IsAtStart('while', eStr[i], True)) then begin
|
||||
eString := eStr[i];
|
||||
|
@ -44,7 +44,7 @@ begin
|
||||
Result := ExtractFilePath(frmSettings.txtPawnCompilerPath.Text) + eInput + '.inc'
|
||||
else if FileExists(ExtractFilePath(frmSettings.txtPawnCompilerPath.Text) + 'include\' + eInput + '.inc') then
|
||||
Result := ExtractFilePath(frmSettings.txtPawnCompilerPath.Text) + 'include\' + eInput + '.inc'
|
||||
else if (FileExists(ExtractFilePath(ActiveDoc.FileName) + eInput + '.inc')) and (not ActiveDoc.Modified) then
|
||||
else if (FileExists(ExtractFilePath(ActiveDoc.FileName) + eInput + '.inc')) then
|
||||
Result := ExtractFilePath(ActiveDoc.FileName) + eInput + '.inc'
|
||||
else
|
||||
Result := '';
|
||||
@ -75,21 +75,20 @@ begin
|
||||
|
||||
for i := 0 to eCode.Count - 1 do begin
|
||||
if (Application.Terminated) or (not Started) or (frmMain.pnlLoading.Visible) or (not frmMain.trvExplorer.Visible) then exit;
|
||||
if Pos('get_user_button', eCode[i]) <> 0 then
|
||||
eCActive := eCActive;
|
||||
|
||||
eBackup := Trim(eCode[i]);
|
||||
eString := RemoveStringsAndComments(Trim(eCode[i]), True, True);
|
||||
if (Pos('/*', eString) = 1) or (Pos('*/', eString) <> 0) then begin
|
||||
eCActive := (Pos('/*', eString) = 1);
|
||||
if Pos('*/', eString) < Pos('/*', eString) then
|
||||
continue
|
||||
else
|
||||
if (Pos('/*', eBackup) = 1) or (Pos('*/', eBackup) <> 0) then begin
|
||||
eCActive := (Pos('/*', eBackup) = 1);
|
||||
if (eCActive) and (Pos('*/', eBackup) <> 0) then begin
|
||||
eCActive := False;
|
||||
continue
|
||||
end;
|
||||
end;
|
||||
if eCActive then
|
||||
if (eBackup = '') or (Pos('//', eBackup) = 1) or (eCActive) then
|
||||
continue;
|
||||
|
||||
eBackup := Trim(eCode[i]);
|
||||
|
||||
|
||||
eProcedureAdded := False;
|
||||
Inc(eTimeToSleep, 1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user