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,16 +540,19 @@ 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
if fDoc.isDSource then
begin begin
lex(fDoc.Lines.Text, fTokList, @lexFindToken); lex(fDoc.Lines.Text, fTokList, @lexFindToken);
md := getModuleName(fTokList); md := getModuleName(fTokList);
fTokList.Clear; fTokList.Clear;
end; end else
if md.isEmpty or (md = '<new document>') then
md := fDoc.fileName.extractFileName; md := fDoc.fileName.extractFileName;
pageControl.currentPage.Caption := md; pageControl.currentPage.Caption := md;
end; end;
end;
{$ENDREGION} {$ENDREGION}
{$REGION Editor context menu ---------------------------------------------------} {$REGION Editor context menu ---------------------------------------------------}