From 9c25a5e206504364edf6ac5b2b62e4951586be68 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sat, 14 Feb 2015 04:40:01 +0100 Subject: [PATCH] tweaked getContext --- src/ce_todolist.pas | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/ce_todolist.pas b/src/ce_todolist.pas index cced6d6a..f1b4bf65 100644 --- a/src/ce_todolist.pas +++ b/src/ce_todolist.pas @@ -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;