don't allow breakpoints to be set on blank lines (fixes #3765)

This commit is contained in:
Ben Fry
2015-09-11 15:27:34 -04:00
parent 04ce0e92bd
commit 2e7d5f3331
3 changed files with 12 additions and 5 deletions

View File

@@ -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);
}
}
}