editor: fix - changes made via source editor now get correctly committed event if...
[fnpeditor.git] / src / editor / modules / rng / rng.js
index 801473b..05e0620 100644 (file)
@@ -142,6 +142,10 @@ return function(sandbox) {
             views.mainLayout.setView('topPanel', sandbox.getModule('mainBar').getView());
         },
         'cmd.save': function() {
+            var sourceEditor = sandbox.getModule('sourceEditor');
+            if(!sourceEditor.changesCommited()) {
+                sourceEditor.commitChanges();
+            }
             sandbox.getModule('data').saveDocument();
         }
     };