mirror of https://gitlab.com/basile.b/dexed.git
generalized usage of dExtList
This commit is contained in:
parent
58616ecb7d
commit
118b747ef7
|
@ -18,7 +18,7 @@ const
|
||||||
libExt = {$IFDEF WINDOWS} '.lib' {$ELSE} '.a' {$ENDIF};
|
libExt = {$IFDEF WINDOWS} '.lib' {$ELSE} '.a' {$ENDIF};
|
||||||
|
|
||||||
var
|
var
|
||||||
DExtList: TStringList;
|
dExtList: TStringList;
|
||||||
DCompiler: string = 'dmd';
|
DCompiler: string = 'dmd';
|
||||||
|
|
||||||
type
|
type
|
||||||
|
@ -136,7 +136,7 @@ type
|
||||||
* Reduces a filename if its length is over the threshold defined by charThresh.
|
* Reduces a filename if its length is over the threshold defined by charThresh.
|
||||||
* Even if the result is not usable anymore, it avoids any "visually-overloaded" MRU menu.
|
* Even if the result is not usable anymore, it avoids any "visually-overloaded" MRU menu.
|
||||||
*)
|
*)
|
||||||
function shortenPath(const aPath: string; charThresh: Word = 80): string;
|
function shortenPath(const aPath: string; charThresh: Word = 60): string;
|
||||||
|
|
||||||
(**
|
(**
|
||||||
* Returns the folder Coedit documents and settings.
|
* Returns the folder Coedit documents and settings.
|
||||||
|
@ -482,7 +482,7 @@ begin
|
||||||
{$HINTS ON}{$WARNINGS ON}
|
{$HINTS ON}{$WARNINGS ON}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function shortenPath(const aPath: string; charThresh: Word = 80): string;
|
function shortenPath(const aPath: string; charThresh: Word = 60): string;
|
||||||
var
|
var
|
||||||
i: NativeInt;
|
i: NativeInt;
|
||||||
sepCnt: NativeInt;
|
sepCnt: NativeInt;
|
||||||
|
@ -728,9 +728,8 @@ end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterClasses([TMRUList, TMRUFileList]);
|
RegisterClasses([TMRUList, TMRUFileList]);
|
||||||
DExtList := TStringList.Create;
|
dExtList := TStringList.Create;
|
||||||
DExtList.Add('.d');
|
dExtList.AddStrings(['.d', '.D', '.di', '.DI', '.Di', '.dI']);
|
||||||
DExtList.Add('.di');
|
|
||||||
finalization
|
finalization
|
||||||
DExtList.Free;
|
dExtList.Free;
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -817,7 +817,7 @@ begin
|
||||||
for str in fSrcs do if str <> '' then
|
for str in fSrcs do if str <> '' then
|
||||||
begin
|
begin
|
||||||
if not
|
if not
|
||||||
listAsteriskPath(str, aList, DExtList)
|
listAsteriskPath(str, aList, dExtList)
|
||||||
then
|
then
|
||||||
aList.Add(str);
|
aList.Add(str);
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -92,7 +92,7 @@ type
|
||||||
|
|
||||||
TMessageKind = (msgkUnknown, msgkInfo, msgkHint, msgkWarn, msgkError);
|
TMessageKind = (msgkUnknown, msgkInfo, msgkHint, msgkWarn, msgkError);
|
||||||
|
|
||||||
function semanticMsgAna2(const aMessg: string): TCEAppMessageKind;
|
function guessMessageKind(const aMessg: string): TCEAppMessageKind;
|
||||||
function getLineFromDmdMessage(const aMessage: string): TPoint;
|
function getLineFromDmdMessage(const aMessage: string): TPoint;
|
||||||
function openFileFromDmdMessage(const aMessage: string): boolean;
|
function openFileFromDmdMessage(const aMessage: string): boolean;
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ var
|
||||||
item: TTreeNode;
|
item: TTreeNode;
|
||||||
begin
|
begin
|
||||||
if aKind = amkAuto then
|
if aKind = amkAuto then
|
||||||
aKind := semanticMsgAna2(aValue);
|
aKind := guessMessageKind(aValue);
|
||||||
dt := new(PMessageData);
|
dt := new(PMessageData);
|
||||||
dt^.data := aData;
|
dt^.data := aData;
|
||||||
dt^.ctxt := aCtxt;
|
dt^.ctxt := aCtxt;
|
||||||
|
@ -474,7 +474,7 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function semanticMsgAna2(const aMessg: string): TCEAppMessageKind;
|
function guessMessageKind(const aMessg: string): TCEAppMessageKind;
|
||||||
var
|
var
|
||||||
pos: Nativeint;
|
pos: Nativeint;
|
||||||
idt: string;
|
idt: string;
|
||||||
|
@ -585,12 +585,16 @@ begin
|
||||||
while(true) do
|
while(true) do
|
||||||
begin
|
begin
|
||||||
inc(i);
|
inc(i);
|
||||||
if i > length(aMessage) then exit;
|
if i > length(aMessage) then
|
||||||
|
exit;
|
||||||
if aMessage[i] = '(' then
|
if aMessage[i] = '(' then
|
||||||
begin
|
begin
|
||||||
if not fileExists(ident) then exit;
|
if not fileExists(ident) then
|
||||||
|
exit;
|
||||||
ext := extractFileExt(ident);
|
ext := extractFileExt(ident);
|
||||||
if not (ext = '.d') or (ext = '.di') then exit;
|
// import(file) : ext may be different
|
||||||
|
if not dExtList.IndexOf(ext) = -1 then
|
||||||
|
exit;
|
||||||
CEMainForm.openFile(ident);
|
CEMainForm.openFile(ident);
|
||||||
result := true;
|
result := true;
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -227,7 +227,7 @@ begin
|
||||||
begin
|
begin
|
||||||
fname := lst.Strings[i];
|
fname := lst.Strings[i];
|
||||||
ext := extractFileExt(fname);
|
ext := extractFileExt(fname);
|
||||||
if (ext = '.d') or (ext = '.di') then
|
if dExtList.IndexOf(ext) <> -1 then
|
||||||
fProject.addSource(fname);
|
fProject.addSource(fname);
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
|
|
|
@ -154,7 +154,7 @@ var
|
||||||
ext: string;
|
ext: string;
|
||||||
begin
|
begin
|
||||||
ext := extractFileExt(aFilename);
|
ext := extractFileExt(aFilename);
|
||||||
if (ext <> '.d') and (ext <> '.di') then
|
if dExtList.IndexOf(ext) = -1 then
|
||||||
Highlighter := nil;
|
Highlighter := nil;
|
||||||
Lines.LoadFromFile(aFilename);
|
Lines.LoadFromFile(aFilename);
|
||||||
fFilename := aFilename;
|
fFilename := aFilename;
|
||||||
|
|
Loading…
Reference in New Issue