summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-04-02 09:45:55 +1000
committerJed Barber <jjbarber@y7mail.com>2017-04-02 09:45:55 +1000
commit73d263cf2bc1d0cfee840df5e6a698eff8b2bd4e (patch)
tree7fa7214c9f9f7e2475ebd061a97856c4e151bc32
parent534e823dcc2a02bd371336c960a8203953b3dddd (diff)
Fixed Load/Save/Undo/Redo Changed bug
-rw-r--r--src/adapad.adb11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/adapad.adb b/src/adapad.adb
index 154e636..46c4258 100644
--- a/src/adapad.adb
+++ b/src/adapad.adb
@@ -150,6 +150,8 @@ package body Adapad is
end if;
Editor.Show_Insert_Position;
Mod_List.Pop;
+ Changed := True;
+ Set_Title;
Bar.Find_Item ("&Edit/&Redo").Activate;
if Mod_List.At_Start then
Bar.Find_Item ("&Edit/&Undo").Deactivate;
@@ -181,6 +183,8 @@ package body Adapad is
Editor.Set_Insert_Position (Integer (Ch.Place));
end if;
Editor.Show_Insert_Position;
+ Changed := True;
+ Set_Title;
Bar.Find_Item ("&Edit/&Undo").Activate;
if Mod_List.At_End then
Bar.Find_Item ("&Edit/&Redo").Deactivate;
@@ -581,7 +585,10 @@ package body Adapad is
Buffer.Load_File (Name);
Filename := To_Unbounded_String (Name);
Changed := False;
- Buffer.Call_Modify_Callbacks;
+ Set_Title;
+ Mod_List := Change_Vectors.Empty_Vector;
+ Editor.Get_Menu_Bar.Find_Item ("&Edit/&Undo").Deactivate;
+ Editor.Get_Menu_Bar.Find_Item ("&Edit/&Redo").Deactivate;
exception
when Storage_Error =>
FLTK.Dialogs.Alert ("Error reading from file " & Name);
@@ -596,7 +603,7 @@ package body Adapad is
Buffer.Save_File (Name);
Filename := To_Unbounded_String (Name);
Changed := False;
- Buffer.Call_Modify_Callbacks;
+ Set_Title;
exception
when Storage_Error =>
FLTK.Dialogs.Alert ("Error writing to file " & Name);