From cfb49499454ef9376dfcb791d52bfaf23da9af23 Mon Sep 17 00:00:00 2001
From: Guillem <guillembartrina@gmail.com>
Date: Tue, 18 Aug 2020 21:17:35 +0200
Subject: [PATCH] fix dirty markings when reloading abstractions

---
 pd/src/g_editor.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c
index 53117ec88..dc7609bf9 100644
--- a/pd/src/g_editor.c
+++ b/pd/src/g_editor.c
@@ -1348,6 +1348,13 @@ static void glist_doreload(t_glist *gl, t_symbol *name, t_symbol *dir,
                 found = 1;
             }
             glist_select(gl, g);
+            if(((t_canvas *)g)->gl_dirty)
+            /* set dirty to 0 to remove the dirty markings*/
+            {
+                glist_amreloadingabstractions = 0;
+                canvas_dirty((t_canvas *)g, 0);
+                glist_amreloadingabstractions = 1;
+            }
             //canvas_setundo(gl, canvas_undo_cut,
             //    canvas_undo_set_cut(gl, UCUT_CLEAR), "clear");
             //canvas_undo_add(gl, 3, "clear",
@@ -1435,6 +1442,13 @@ void canvas_reload_ab_rec(t_canvas *x, t_ab_definition *a, t_gobj *e)
                 found = 1;
             }
             glist_select(x, g);
+            if(((t_canvas *)g)->gl_dirty)
+            /* set dirty to 0 to remove the dirty markings*/
+            {
+                glist_amreloadingabstractions = 0;
+                canvas_dirty((t_canvas *)g, 0);
+                glist_amreloadingabstractions = 1;
+            }
         }
         else if(g == e)
             canvas_initbang((t_canvas *)g);
-- 
GitLab