From 4aac13c19fc3e43552e4b6e67f5f93786ee6a76b Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Tue, 12 Jan 2016 14:22:01 +0300 Subject: [PATCH] fix breakpoint setting; add breakpoint toggle with left button click on editor line icons pane - close #95 --- src/dlangide/ui/dsourceedit.d | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/dlangide/ui/dsourceedit.d b/src/dlangide/ui/dsourceedit.d index 04d84e1..aca5c62 100644 --- a/src/dlangide/ui/dsourceedit.d +++ b/src/dlangide/ui/dsourceedit.d @@ -222,6 +222,19 @@ class DSourceEdit : SourceEdit, EditableContentMarksChangeListener { return super.handleAction(a); } + /// left button click on icons panel: toggle breakpoint + override protected bool handleLeftPaneIconsMouseClick(MouseEvent event, Rect rc, int line) { + if (event.button == MouseButton.Left) { + LineIcon icon = content.lineIcons.findByLineAndType(line, LineIconType.breakpoint); + if (icon) + removeBreakpoint(line, icon); + else + addBreakpoint(line); + return true; + } + return super.handleLeftPaneIconsMouseClick(event, rc, line); + } + protected void addBreakpoint(int line) { import std.path; Breakpoint bp = new Breakpoint();