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};
|
||||
|
||||
var
|
||||
DExtList: TStringList;
|
||||
dExtList: TStringList;
|
||||
DCompiler: string = 'dmd';
|
||||
|
||||
type
|
||||
|
@ -136,7 +136,7 @@ type
|
|||
* 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.
|
||||
*)
|
||||
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.
|
||||
|
@ -482,7 +482,7 @@ begin
|
|||
{$HINTS ON}{$WARNINGS ON}
|
||||
end;
|
||||
|
||||
function shortenPath(const aPath: string; charThresh: Word = 80): string;
|
||||
function shortenPath(const aPath: string; charThresh: Word = 60): string;
|
||||
var
|
||||
i: NativeInt;
|
||||
sepCnt: NativeInt;
|
||||
|
@ -728,9 +728,8 @@ end;
|
|||
|
||||
initialization
|
||||
RegisterClasses([TMRUList, TMRUFileList]);
|
||||
DExtList := TStringList.Create;
|
||||
DExtList.Add('.d');
|
||||
DExtList.Add('.di');
|
||||
dExtList := TStringList.Create;
|
||||
dExtList.AddStrings(['.d', '.D', '.di', '.DI', '.Di', '.dI']);
|
||||
finalization
|
||||
DExtList.Free;
|
||||
dExtList.Free;
|
||||
end.
|
||||
|
|
|
@ -817,7 +817,7 @@ begin
|
|||
for str in fSrcs do if str <> '' then
|
||||
begin
|
||||
if not
|
||||
listAsteriskPath(str, aList, DExtList)
|
||||
listAsteriskPath(str, aList, dExtList)
|
||||
then
|
||||
aList.Add(str);
|
||||
end;
|
||||
|
|
|
@ -92,7 +92,7 @@ type
|
|||
|
||||
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 openFileFromDmdMessage(const aMessage: string): boolean;
|
||||
|
||||
|
@ -360,7 +360,7 @@ var
|
|||
item: TTreeNode;
|
||||
begin
|
||||
if aKind = amkAuto then
|
||||
aKind := semanticMsgAna2(aValue);
|
||||
aKind := guessMessageKind(aValue);
|
||||
dt := new(PMessageData);
|
||||
dt^.data := aData;
|
||||
dt^.ctxt := aCtxt;
|
||||
|
@ -474,7 +474,7 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
function semanticMsgAna2(const aMessg: string): TCEAppMessageKind;
|
||||
function guessMessageKind(const aMessg: string): TCEAppMessageKind;
|
||||
var
|
||||
pos: Nativeint;
|
||||
idt: string;
|
||||
|
@ -585,12 +585,16 @@ begin
|
|||
while(true) do
|
||||
begin
|
||||
inc(i);
|
||||
if i > length(aMessage) then exit;
|
||||
if i > length(aMessage) then
|
||||
exit;
|
||||
if aMessage[i] = '(' then
|
||||
begin
|
||||
if not fileExists(ident) then exit;
|
||||
if not fileExists(ident) then
|
||||
exit;
|
||||
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);
|
||||
result := true;
|
||||
end;
|
||||
|
|
|
@ -227,7 +227,7 @@ begin
|
|||
begin
|
||||
fname := lst.Strings[i];
|
||||
ext := extractFileExt(fname);
|
||||
if (ext = '.d') or (ext = '.di') then
|
||||
if dExtList.IndexOf(ext) <> -1 then
|
||||
fProject.addSource(fname);
|
||||
end;
|
||||
finally
|
||||
|
|
|
@ -154,7 +154,7 @@ var
|
|||
ext: string;
|
||||
begin
|
||||
ext := extractFileExt(aFilename);
|
||||
if (ext <> '.d') and (ext <> '.di') then
|
||||
if dExtList.IndexOf(ext) = -1 then
|
||||
Highlighter := nil;
|
||||
Lines.LoadFromFile(aFilename);
|
||||
fFilename := aFilename;
|
||||
|
|
Loading…
Reference in New Issue