From 5937dc091fa23576c78f19cd1d1d356a0cc08d11 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sat, 15 Aug 2015 12:40:27 -0400 Subject: [PATCH] hitting Run should restart the sketch, even when debugging (fixes #3623) --- java/src/processing/mode/java/JavaEditor.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/java/src/processing/mode/java/JavaEditor.java b/java/src/processing/mode/java/JavaEditor.java index cb5e56a6f..7f3032ac4 100644 --- a/java/src/processing/mode/java/JavaEditor.java +++ b/java/src/processing/mode/java/JavaEditor.java @@ -1142,6 +1142,11 @@ public class JavaEditor extends Editor { public void handleRun() { if (isDebuggerEnabled()) { + // Hitting Run while a sketch is running should restart the sketch + // https://github.com/processing/processing/issues/3623 + if (debugger.isStarted()) { + debugger.stopDebug(); + } // Don't start the sketch paused, continue until a breakpoint or error // https://github.com/processing/processing/issues/3096 debugger.continueDebug();