tweaked getContext

This commit is contained in:
Basile Burg 2015-02-14 04:40:01 +01:00
parent 78318f90a7
commit 9c25a5e206
1 changed files with 3 additions and 7 deletions

View File

@ -251,7 +251,6 @@ end;
procedure TCETodoListWidget.docChanged(aDoc: TCESynMemo);
begin
if fDoc <> aDoc then exit;
end;
procedure TCETodoListWidget.docClosing(aDoc: TCESynMemo);
@ -298,15 +297,12 @@ end;
{$REGION Todo list things ------------------------------------------------------}
function TCETodoListWidget.getContext: TTodoContext;
begin
result := tcNone;
//
if ((fProj = nil) and (fDoc = nil)) then exit;
if ((fProj = nil) and (fDoc = nil)) then exit(tcNone);
if ((fProj = nil) and (fDoc <> nil)) then exit(tcFile);
if ((fProj <> nil) and (fDoc = nil)) then exit(tcProject);
//
result := tcFile;
if not FileExists(fDoc.fileName) then exit;
if fProj.isProjectSource(fDoc.fileName) then exit(tcProject);
if fProj.isProjectSource(fDoc.fileName) then
exit(tcProject) else exit(tcFile);
end;
procedure TCETodoListWidget.killToolProcess;