fix #23, page caption for dd files

This commit is contained in:
Basile Burg 2016-02-29 08:28:43 +01:00
parent 1d3c14c000
commit 7451c0e052
1 changed files with 10 additions and 7 deletions

View File

@ -540,15 +540,18 @@ begin
if fDoc.Lines.Count = 0 then exit; if fDoc.Lines.Count = 0 then exit;
// //
md := pageControl.currentPage.Caption; md := pageControl.currentPage.Caption;
if (fDoc.isDSource and (fDoc.CaretY < 50)) or (md = fDoc.fileName.extractFileName) then if ((fDoc.CaretY < 50) or (md.isEmpty) or (md = '<new document>'))
or ((md = fDoc.fileName.extractFileName) and (fDoc.isDSource)) then
begin begin
lex(fDoc.Lines.Text, fTokList, @lexFindToken); if fDoc.isDSource then
md := getModuleName(fTokList); begin
fTokList.Clear; lex(fDoc.Lines.Text, fTokList, @lexFindToken);
md := getModuleName(fTokList);
fTokList.Clear;
end else
md := fDoc.fileName.extractFileName;
pageControl.currentPage.Caption := md;
end; end;
if md.isEmpty or (md = '<new document>') then
md := fDoc.fileName.extractFileName;
pageControl.currentPage.Caption := md;
end; end;
{$ENDREGION} {$ENDREGION}