diff --git a/graph.coffee b/graph.coffee index 7e3b760..6fb83f1 100644 --- a/graph.coffee +++ b/graph.coffee @@ -75,6 +75,11 @@ module.directive 'graph', ($location) -> $scope.edit_node = (node) -> $location.path "/#{node.implementation.id}" + # update debugger + new_debugger_scope = $scope.$root.debugger_scope?.nodes[node.id] + if new_debugger_scope? + $scope.$root.debugger_scope = new_debugger_scope + $scope.can_bust_selected_node = -> $scope.selection.length is 1 and $scope.selection[0].implementation instanceof interpreter.Graph $scope.bust_selected_node = -> diff --git a/graph.js b/graph.js index 9476950..132de7d 100644 --- a/graph.js +++ b/graph.js @@ -110,7 +110,12 @@ return $scope.selection.length === 1; }; $scope.edit_node = function(node) { - return $location.path("/" + node.implementation.id); + var new_debugger_scope, _ref; + $location.path("/" + node.implementation.id); + new_debugger_scope = (_ref = $scope.$root.debugger_scope) != null ? _ref.nodes[node.id] : void 0; + if (new_debugger_scope != null) { + return $scope.$root.debugger_scope = new_debugger_scope; + } }; $scope.can_bust_selected_node = function() { return $scope.selection.length === 1 && $scope.selection[0].implementation instanceof interpreter.Graph; diff --git a/stuff.coffee b/stuff.coffee index 5092d45..7ae1033 100644 --- a/stuff.coffee +++ b/stuff.coffee @@ -175,6 +175,7 @@ module.controller 'subroutine', ($scope, $routeParams, interpreter, $q) -> module.controller 'debugger', ($scope, $location) -> $scope.debug = -> + $scope.$root.debugger_scope = $scope.$root.runtime.scope $scope.$root.runtime.cleanup() $scope.$root.debug_step = 0 $scope.$root.debugger = true diff --git a/stuff.js b/stuff.js index 0326ef4..e9a8937 100644 --- a/stuff.js +++ b/stuff.js @@ -246,6 +246,7 @@ module.controller('debugger', function($scope, $location) { $scope.debug = function() { + $scope.$root.debugger_scope = $scope.$root.runtime.scope; $scope.$root.runtime.cleanup(); $scope.$root.debug_step = 0; $scope.$root["debugger"] = true; diff --git a/subroutine.html b/subroutine.html index 27d9757..0115ace 100644 --- a/subroutine.html +++ b/subroutine.html @@ -61,7 +61,7 @@