mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
Fixed bug at48523
This commit is contained in:
parent
93cb2060dd
commit
266ed797c5
Binary file not shown.
@ -80,7 +80,7 @@ function IEInstalled: Boolean;
|
||||
function GetAMXXDir(ListenServer: Boolean): String;
|
||||
|
||||
function CloseDocument(eDocument: TDocument; SaveActiveDoc, RemoveTab: Boolean): Boolean;
|
||||
function AddExtension(eFilename, eHighlighter: String): String;
|
||||
function AddExtension(eFilename, eHighlighter: String; Document: TDocument): String;
|
||||
|
||||
function ShowColorDialog(var Color: TColor; ePaintImage: TImage): Boolean;
|
||||
|
||||
@ -468,11 +468,15 @@ begin
|
||||
Collection.Close(eDocument.Index, RemoveTab);
|
||||
end;
|
||||
|
||||
function AddExtension(eFilename, eHighlighter: String): String;
|
||||
function AddExtension(eFilename, eHighlighter: String; Document: TDocument): String;
|
||||
begin
|
||||
if ExtractFileExt(eFilename) = '' then begin
|
||||
if eHighlighter = 'Pawn' then
|
||||
if eHighlighter = 'Pawn' then begin
|
||||
if (ExtractFileExt(Document.Title) = '.inc') then
|
||||
Result := eFilename + '.inc'
|
||||
else
|
||||
Result := eFilename + '.sma';
|
||||
end;
|
||||
if eHighlighter = 'C++' then
|
||||
Result := eFilename + '.cpp';
|
||||
if eHighlighter = 'HTML' then
|
||||
|
@ -894,7 +894,7 @@ end;
|
||||
procedure TfrmMain.mnuSaveAsClick(Sender: TObject);
|
||||
begin
|
||||
if sdSave.Execute then begin
|
||||
ActiveDoc.FileName := AddExtension(sdSave.FileName, ActiveDoc.Highlighter);
|
||||
ActiveDoc.FileName := AddExtension(sdSave.FileName, ActiveDoc.Highlighter, ActiveDoc);
|
||||
ActiveDoc.Save;
|
||||
tbDocs.Tabs[ActiveDoc.Index].Caption := ActiveDoc.Title;
|
||||
end;
|
||||
@ -1296,7 +1296,7 @@ begin
|
||||
b := Integer(frmAllFilesForm.lstFiles.Items.Objects[a]);
|
||||
if TDocument(Collection.Items[b]).Untitled then begin
|
||||
if sdSave.Execute then begin
|
||||
TDocument(Collection.Items[b]).FileName := AddExtension(sdSave.FileName, TDocument(Collection.Items[b]).Highlighter);
|
||||
TDocument(Collection.Items[b]).FileName := AddExtension(sdSave.FileName, TDocument(Collection.Items[b]).Highlighter, TDocument(Collection.Items[b]));
|
||||
TDocument(Collection.Items[b]).Save;
|
||||
TJvTabBarItem(tbDocs.Tabs[b]).Caption := TDocument(Collection.Items[b]).Title;
|
||||
end
|
||||
@ -1547,7 +1547,7 @@ begin
|
||||
else begin
|
||||
frmMain.sdSave.FilterIndex := 1;
|
||||
if frmMain.sdSave.Execute then begin
|
||||
eItem.FileName := AddExtension(frmMain.sdSave.FileName, eItem.Highlighter);
|
||||
eItem.FileName := AddExtension(frmMain.sdSave.FileName, eItem.Highlighter, eItem);
|
||||
eItem.Save;
|
||||
end
|
||||
else begin
|
||||
@ -1571,7 +1571,7 @@ begin
|
||||
else begin
|
||||
frmMain.sdSave.FilterIndex := 2;
|
||||
if frmMain.sdSave.Execute then begin
|
||||
eItem.FileName := AddExtension(frmMain.sdSave.FileName, eItem.Highlighter);
|
||||
eItem.FileName := AddExtension(frmMain.sdSave.FileName, eItem.Highlighter, eItem);
|
||||
eItem.Save;
|
||||
end
|
||||
else begin
|
||||
@ -1595,7 +1595,7 @@ begin
|
||||
else begin
|
||||
frmMain.sdSave.FilterIndex := 0;
|
||||
if frmMain.sdSave.Execute then begin
|
||||
eItem.FileName := AddExtension(frmMain.sdSave.FileName, eItem.Highlighter);
|
||||
eItem.FileName := AddExtension(frmMain.sdSave.FileName, eItem.Highlighter, eItem);
|
||||
eItem.Save;
|
||||
end
|
||||
else begin
|
||||
|
Loading…
Reference in New Issue
Block a user