Skip to content

Commit

Permalink
fix: saving of ed2 with splitted tab, editing in ed1 - no circle-mark
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-T committed Dec 2, 2023
1 parent dc1d9d9 commit 4ddc56a
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions app/formframe.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1752,22 +1752,22 @@ procedure TEditorFrame.EditorOnChangeDetailed(Sender: TObject;
EdOther: TATSynEdit;
begin
if FBusyOnChangeDetailed then exit;
FBusyOnChangeDetailed:= true;
if Splitted and EditorsLinked then
begin
if Sender=Ed1 then
EdOther:= Ed2
else
EdOther:= Ed1;
FBusyOnChangeDetailed:= true;
EdOther.UpdateCaretsAndMarkersOnEditing(0, APos, APosEnd, AShift, APosAfter);
EdOther.DoGotoCaret(
TATCaretEdge.Top,
false,
false,
false
);
FBusyOnChangeDetailed:= false;
end;
FBusyOnChangeDetailed:= false;
end;

procedure TEditorFrame.EditorOnChangeModified(Sender: TObject);
Expand Down Expand Up @@ -3264,6 +3264,21 @@ function TEditorFrame.DoFileSave_Ex(Ed: TATSynEdit; ASaveAs: boolean): boolean;
else
FileProps[EdIndex].Init(SFileName);

{
fixes issue:
- open new tab
- save to file
- split it to ed1/ed2
- edit in ed2; then edit in ed1 -> circle-mark shows
- focus ed2, save to file -> circle-mark hides
- focus ed1, edit -> circle-mark don't show (ed1 don't fire OnChangeModified)
}
if Result and EditorsLinked then
begin
Ed1.Modified:= false;
Ed2.Modified:= false;
end;

NotifEnabled:= bNotifWasEnabled or bNameChanged;
end;

Expand Down

0 comments on commit 4ddc56a

Please sign in to comment.