mirror of
https://github.com/processing/processing4.git
synced 2026-01-29 19:31:16 +01:00
don't allow breakpoints to be set on blank lines (fixes #3765)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user