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