From 08ef69ce8950280549948ce4ddffdf7dc446f314 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Fri, 16 Jan 2015 04:23:31 +0100 Subject: [PATCH] fix, dbl click todo item, av --- src/ce_todolist.pas | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ce_todolist.pas b/src/ce_todolist.pas index 6fb416f3..836109c8 100644 --- a/src/ce_todolist.pas +++ b/src/ce_todolist.pas @@ -353,15 +353,21 @@ end; procedure TCETodoListWidget.lstItemsDoubleClick(sender: TObject); var itm: TTodoItem; + fname: string; + ln: string; begin if lstItems.Selected = nil then exit; if lstItems.Selected.Data = nil then exit; - // + // the collection will be cleared if a file is opened + // docFocused->callToolProcess->fTodos....clear + // so line and filename must be copied itm := TTodoItem(lstItems.Selected.Data); - CEMainForm.openFile(itm.filename); + fname := itm.filename; + ln := itm.line; + CEMainForm.openFile(fname); // if fDoc = nil then exit; - fDoc.CaretY := strToInt(itm.line); + fDoc.CaretY := strToInt(ln); fDoc.SelectLine; end;