IDE: Update source editor window caption after saving a file. Issue #41645.

This commit is contained in:
Juha 2025-07-04 03:55:01 +03:00
parent de12e8ae7b
commit f70d066373
2 changed files with 14 additions and 7 deletions

View File

@ -948,6 +948,7 @@ type
procedure MoveEditor(OldPageIndex, NewWindowIndex, NewPageIndex: integer);
procedure AddControlToEditor(aSourceEditor : TSourceEditorInterface; aControl : TControl; aAlign : TAlign); override;
procedure UpdateCaption;
procedure UpdateStatusBar;
function AddStatusPanel(AnOwner: TClass; ATag: PtrUInt = 0): TSourceEditorStatusPanelInterface; override;
function StatusPanelCount(AnOwner: TClass): integer; override;
@ -8238,13 +8239,7 @@ begin
PageIndex := i;
dec(FFocusLock);
SourceEditorManager.ActiveSourceWindow := Self;
if EditorOpts.ShowFileNameInCaption then
begin
if ActiveEditor<>nil then
Caption := BaseCaption+' - '+ActiveEditor.FileName
else
Caption := BaseCaption;
end;
UpdateCaption;
end;
procedure TSourceNotebook.SetBaseCaption(AValue: String);
@ -9336,6 +9331,17 @@ begin
GetActiveSE.IsLocked := not GetActiveSE.IsLocked;
end;
}
procedure TSourceNotebook.UpdateCaption;
begin
if EditorOpts.ShowFileNameInCaption then
begin
if ActiveEditor<>nil then
Caption := BaseCaption+' - '+ActiveEditor.FileName
else
Caption := BaseCaption;
end;
end;
procedure TSourceNotebook.UpdateStatusBar;
var
tempEditor: TSourceEditor;

View File

@ -2916,6 +2916,7 @@ begin
MainIDE.UpdateSaveMenuItemsAndButtons(not (sfProjectSaving in Flags));
end;
TSourceEditor(AEditor).SourceNotebook.UpdateStatusBar;
TSourceEditor(AEditor).SourceNotebook.UpdateCaption;
// fix all references
if not (sfSkipReferences in Flags) then begin