From e6f0a3fdbe934f87b2a877d6f048136795ecb345 Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 11 Mar 2009 15:13:31 +0000 Subject: [PATCH] ide: fix breakpoint toggling for line where the execution line is placed git-svn-id: trunk@18958 - --- ide/sourceeditor.pp | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp index e6d7a83bba..c6aa71a968 100644 --- a/ide/sourceeditor.pp +++ b/ide/sourceeditor.pp @@ -2082,15 +2082,34 @@ end; procedure TSourceEditor.OnGutterClick(Sender: TObject; X, Y, Line: integer; mark: TSynEditMark); var - BreakPtMark: TSourceMark; + Marks: PSourceMark; + i, MarkCount: Integer; + BreakFound, ExecutionFound: Boolean; begin // create or delete breakpoint // find breakpoint mark at line - BreakPtMark := SourceEditorMarks.FindBreakPointMark(FEditor,Line); - if BreakPtMark = nil then - DebugBoss.DoCreateBreakPoint(Filename,Line,true) - else - DebugBoss.DoDeleteBreakPointAtMark(BreakPtMark); + SourceEditorMarks.GetMarksForLine(FEditor, Line, Marks, MarkCount); + BreakFound := False; + ExecutionFound := False; + for i := 0 to MarkCount - 1 do + begin + if not Marks[i].Visible then + Continue; + if Marks[i].IsBreakPoint then + begin + BreakFound := True; + DebugBoss.DoDeleteBreakPointAtMark(Marks[i]) + end + else + if Marks[i] = FExecutionMark then + ExecutionFound := True; + end; + + if not BreakFound then + DebugBoss.DoCreateBreakPoint(Filename, Line, True); + + if ExecutionFound then + UpdateExecutionSourceMark; end; procedure TSourceEditor.OnEditorSpecialLineColor(Sender: TObject; Line: integer;