From 2e7d5f3331159790ea37b71b5a4ac0a28131e31b Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Fri, 11 Sep 2015 15:27:34 -0400 Subject: [PATCH] don't allow breakpoints to be set on blank lines (fixes #3765) --- core/todo.txt | 3 ++- java/src/processing/mode/java/Debugger.java | 9 +++++++-- todo.txt | 5 +++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/core/todo.txt b/core/todo.txt index 3c84ebafc..4f9b19da7 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -37,6 +37,8 @@ X line direction vectors are incorrectly transformed X https://github.com/processing/processing/issues/3779 X Strokes in 3D PShapes are not properly connected X https://github.com/processing/processing/issues/3756 +X setting surface properties hangs OpenGL sketches +X https://github.com/processing/processing/issues/3789 jakub X FX - fix transformation stack NPE @@ -110,7 +112,6 @@ _ update wiki/docs to say "don't override sketchXxxx() methods" _ SVG only exports last frame _ possibly because Java2D is disposing the Graphics2D in between? _ https://github.com/processing/processing/issues/3753 - _ selectInput/Output() is behind the drawing window (Windows) _ https://github.com/processing/processing/issues/3775 diff --git a/java/src/processing/mode/java/Debugger.java b/java/src/processing/mode/java/Debugger.java index 9f79a1fee..db972c680 100644 --- a/java/src/processing/mode/java/Debugger.java +++ b/java/src/processing/mode/java/Debugger.java @@ -477,10 +477,15 @@ public class Debugger implements VMEventListener { */ synchronized void toggleBreakpoint(int lineIdx) { LineID line = editor.getLineIDInCurrentTab(lineIdx); + int index = line.lineIdx(); if (hasBreakpoint(line)) { - removeBreakpoint(line.lineIdx()); + removeBreakpoint(index); } else { - setBreakpoint(line.lineIdx()); + // Make sure the line contains actual code before setting the break + // https://github.com/processing/processing/issues/3765 + if (editor.getLineText(index).trim().length() != 0) { + setBreakpoint(index); + } } } diff --git a/todo.txt b/todo.txt index 90c72c0b6..474712bcb 100644 --- a/todo.txt +++ b/todo.txt @@ -17,6 +17,8 @@ X https://github.com/processing/processing/issues/3786 X confusion when // tweak is used X https://github.com/processing/processing/issues/3742 X change to /// tweak instead +X don't allow breakpoints to be set on blank lines +X https://github.com/processing/processing/issues/3765 jakub X Error/warning location visualisation not updating when editor resizes @@ -67,6 +69,7 @@ _ https://github.com/processing/processing/issues/3543 _ move to javapackager or another option? _ http://www.excelsiorjet.com/kb/35/howto-create-a-single-exe-from-your-java-application _ mouse events (i.e. toggle breakpoint) seem to be firing twice +_ non-standard cursor images used for OpenGL 3.0 final @@ -113,8 +116,6 @@ _ add this to the preferences? gui -_ don't allow breakpoints to be set on blank lines -_ https://github.com/processing/processing/issues/3765 _ different design of squiggly line? _ build custom scroll bar since the OS versions are so ugly? _ error/warning location is awkward when no scroll bar is in use