fix #415 - Clicking a Todo item does not position the cursor

This commit is contained in:
Basile Burg 2019-01-22 08:33:21 +01:00
parent 2f8be4cbc2
commit f325ff7b2e
1 changed files with 3 additions and 2 deletions

View File

@ -329,14 +329,15 @@ end;
procedure TTodoListWidget.docFocused(document: TDexedMemo);
begin
if fdoc.isNil then
if document.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
if fDoc.isNotNil and (document = fDoc) and (fDoc.fileName = document.fileName) then
exit;
fDoc := document;
if Visible and fAutoRefresh then