mirror of https://gitlab.com/basile.b/dexed.git
fix #412 - todo list empty when opening a file owned by the project for the first time
This commit is contained in:
parent
842d5b7c3b
commit
abe56ec68e
|
@ -329,7 +329,14 @@ end;
|
||||||
|
|
||||||
procedure TTodoListWidget.docFocused(document: TDexedMemo);
|
procedure TTodoListWidget.docFocused(document: TDexedMemo);
|
||||||
begin
|
begin
|
||||||
if document = fDoc then
|
if fdoc.isNil then
|
||||||
|
exit;
|
||||||
|
// issue 412 :
|
||||||
|
// 1. the file name is in a first time "<new document>"
|
||||||
|
// 2. document assigned the fDoc var
|
||||||
|
// 3. once the filename loaded it exited on next focused
|
||||||
|
// because diff for filename was not tested.
|
||||||
|
if (document = fDoc) and (fDoc.fileName = document.fileName) then
|
||||||
exit;
|
exit;
|
||||||
fDoc := document;
|
fDoc := document;
|
||||||
if Visible and fAutoRefresh then
|
if Visible and fAutoRefresh then
|
||||||
|
@ -425,16 +432,17 @@ var
|
||||||
str: string = '';
|
str: string = '';
|
||||||
begin
|
begin
|
||||||
clearTodoList;
|
clearTodoList;
|
||||||
|
if not exeInSysPath(ToolExeName) then
|
||||||
|
exit;
|
||||||
|
killToolProcess;
|
||||||
|
|
||||||
ctxt := getContext;
|
ctxt := getContext;
|
||||||
case ctxt of
|
case ctxt of
|
||||||
tcNone: exit;
|
tcNone: exit;
|
||||||
tcProject: if (fProj = nil) or (fProj.sourcesCount = 0) then exit;
|
tcProject: if (fProj = nil) or (fProj.sourcesCount = 0) then exit;
|
||||||
tcFile: if fDoc = nil then exit;
|
tcFile: if fDoc = nil then exit;
|
||||||
end;
|
end;
|
||||||
if not exeInSysPath(ToolExeName) then
|
|
||||||
exit;
|
|
||||||
//
|
|
||||||
killToolProcess;
|
|
||||||
fToolProc := TDexedProcess.Create(nil);
|
fToolProc := TDexedProcess.Create(nil);
|
||||||
fToolProc.Executable := exeFullName(ToolExeName);
|
fToolProc.Executable := exeFullName(ToolExeName);
|
||||||
fToolProc.Options := [poUsePipes];
|
fToolProc.Options := [poUsePipes];
|
||||||
|
@ -459,7 +467,7 @@ begin
|
||||||
else str := fDoc.fileName;
|
else str := fDoc.fileName;
|
||||||
fToolProc.Parameters.Add('-f' + str);
|
fToolProc.Parameters.Add('-f' + str);
|
||||||
fToolProc.Parameters.Add('-t');
|
fToolProc.Parameters.Add('-t');
|
||||||
//
|
|
||||||
fToolProc.Execute;
|
fToolProc.Execute;
|
||||||
fToolProc.CloseInput;
|
fToolProc.CloseInput;
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Reference in New Issue