mirror of https://gitlab.com/basile.b/dexed.git
fix #46, The generic highlighter is not selected when saving a non D file
This commit is contained in:
parent
361502ff6a
commit
c75de19110
|
@ -4356,7 +4356,6 @@ object CEMainForm: TCEMainForm
|
|||
Images = imgList
|
||||
OnUpdate = ActionsUpdate
|
||||
left = 32
|
||||
top = 1
|
||||
object actEdCopy: TAction
|
||||
Category = 'Edit'
|
||||
Caption = 'Copy'
|
||||
|
|
|
@ -2663,12 +2663,16 @@ begin
|
|||
end;
|
||||
|
||||
procedure TCEMainForm.saveProjSource(const aEditor: TCESynMemo);
|
||||
var
|
||||
fname: string;
|
||||
begin
|
||||
if fProject = nil then exit;
|
||||
if fProject.filename <> aEditor.fileName then exit;
|
||||
//
|
||||
aEditor.saveToFile(fProject.filename);
|
||||
openProj(fProject.filename);
|
||||
fname := fProject.filename;
|
||||
fProject.getProject.Free;
|
||||
aEditor.saveToFile(fname);
|
||||
openProj(fname);
|
||||
end;
|
||||
|
||||
procedure TCEMainForm.closeProj;
|
||||
|
@ -2755,9 +2759,8 @@ end;
|
|||
|
||||
procedure TCEMainForm.actProjCloseExecute(Sender: TObject);
|
||||
begin
|
||||
if (fProject <> nil) and not fProject.inGroup and
|
||||
fProject.modified and
|
||||
(dlgFileChangeClose(fProject.filename) = mrCancel) then exit;
|
||||
if (fProject <> nil) and not fProject.inGroup and fProject.modified and
|
||||
(dlgFileChangeClose(fProject.filename) = mrCancel) then exit;
|
||||
closeProj;
|
||||
end;
|
||||
|
||||
|
@ -2812,6 +2815,7 @@ begin
|
|||
if not fProject.filename.fileExists then exit;
|
||||
//
|
||||
openFile(fProject.filename);
|
||||
fDoc.isProjectDescription := true;
|
||||
if fProject.getFormat = pfNative then
|
||||
fDoc.Highlighter := LfmSyn
|
||||
else
|
||||
|
|
|
@ -146,6 +146,7 @@ type
|
|||
fDetectIndentMode: boolean;
|
||||
fPhobosDocRoot: string;
|
||||
fAlwaysAdvancedFeatures: boolean;
|
||||
fIsProjectDescription: boolean;
|
||||
procedure decCallTipsLvl;
|
||||
procedure setMatchOpts(value: TIdentifierMatchOptions);
|
||||
function getMouseFileBytePos: Integer;
|
||||
|
@ -226,6 +227,7 @@ type
|
|||
property isTemporary: boolean read getIfTemp;
|
||||
property TextView;
|
||||
//
|
||||
property isProjectDescription: boolean read fIsProjectDescription write fIsProjectDescription;
|
||||
property alwaysAdvancedFeatures: boolean read fAlwaysAdvancedFeatures write fAlwaysAdvancedFeatures;
|
||||
property phobosDocRoot: string read fPhobosDocRoot write fPhobosDocRoot;
|
||||
property detectIndentMode: boolean read fDetectIndentMode write fDetectIndentMode;
|
||||
|
@ -1529,7 +1531,9 @@ begin
|
|||
ext := aFilename.extractFileExt;
|
||||
fIsDsource := hasDlangSyntax(ext);
|
||||
if fIsDsource then
|
||||
Highlighter := fD2Highlighter;
|
||||
Highlighter := fD2Highlighter
|
||||
else if not isProjectDescription then
|
||||
Highlighter := TxtHighlighter;
|
||||
FileAge(fFilename, fFileDate);
|
||||
fModified := false;
|
||||
if fFilename <> fTempFileName then
|
||||
|
|
Loading…
Reference in New Issue