ide: fix breakpoint toggling for line where the execution line is placed

git-svn-id: trunk@18958 -
This commit is contained in:
paul 2009-03-11 15:13:31 +00:00
parent 9c4108f86d
commit e6f0a3fdbe

View File

@ -2082,15 +2082,34 @@ end;
procedure TSourceEditor.OnGutterClick(Sender: TObject; X, Y, Line: integer; procedure TSourceEditor.OnGutterClick(Sender: TObject; X, Y, Line: integer;
mark: TSynEditMark); mark: TSynEditMark);
var var
BreakPtMark: TSourceMark; Marks: PSourceMark;
i, MarkCount: Integer;
BreakFound, ExecutionFound: Boolean;
begin begin
// create or delete breakpoint // create or delete breakpoint
// find breakpoint mark at line // find breakpoint mark at line
BreakPtMark := SourceEditorMarks.FindBreakPointMark(FEditor,Line); SourceEditorMarks.GetMarksForLine(FEditor, Line, Marks, MarkCount);
if BreakPtMark = nil then BreakFound := False;
DebugBoss.DoCreateBreakPoint(Filename,Line,true) ExecutionFound := False;
else for i := 0 to MarkCount - 1 do
DebugBoss.DoDeleteBreakPointAtMark(BreakPtMark); 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; end;
procedure TSourceEditor.OnEditorSpecialLineColor(Sender: TObject; Line: integer; procedure TSourceEditor.OnEditorSpecialLineColor(Sender: TObject; Line: integer;