From e019c8117524fa4477622786f533cdee9a7feba3 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Tue, 16 Feb 2016 18:56:29 +0100 Subject: [PATCH] fix #14 --- src/ce_editor.pas | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ce_editor.pas b/src/ce_editor.pas index a19191c0..0ea552be 100644 --- a/src/ce_editor.pas +++ b/src/ce_editor.pas @@ -539,14 +539,15 @@ begin fKeyChanged := false; if fDoc.Lines.Count = 0 then exit; // - md := ''; - if fDoc.isDSource and (fDoc.CaretY < 50) then + md := pageControl.currentPage.Caption; + if (fDoc.isDSource and (fDoc.CaretY < 50)) or (md = fDoc.fileName.extractFileName) then begin lex(fDoc.Lines.Text, fTokList, @lexFindToken); md := getModuleName(fTokList); fTokList.Clear; end; - if md.isEmpty then md := fDoc.fileName.extractFileName; + if md.isEmpty or (md = '') then + md := fDoc.fileName.extractFileName; pageControl.currentPage.Caption := md; end; {$ENDREGION}