From 23b71d0f1157d8b896f7774fba1d39aa6d99a45d Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Mon, 10 Jul 2017 08:50:25 +0200 Subject: [PATCH] fix, upstream regression, debug gutter icons mostly broken --- icons/other/{breaks.png => break_reached.png} | Bin icons/other/break_set.png | Bin 0 -> 425 bytes src/ce_editor.pas | 1 - src/ce_synmemo.pas | 35 +++++++++--------- 4 files changed, 17 insertions(+), 19 deletions(-) rename icons/other/{breaks.png => break_reached.png} (100%) create mode 100644 icons/other/break_set.png diff --git a/icons/other/breaks.png b/icons/other/break_reached.png similarity index 100% rename from icons/other/breaks.png rename to icons/other/break_reached.png diff --git a/icons/other/break_set.png b/icons/other/break_set.png new file mode 100644 index 0000000000000000000000000000000000000000..de6bea89ba56c7fff95186bc84ea26890229baf5 GIT binary patch literal 425 zcmV;a0apHrP)%T-`JMs;ytF?rY_R}7@ZyfvbY@FJD|~2;`!tp z{_(*>*;G|f2l0AG0s(0$C2s9ZCS$)B>eu=D@liXUGg#d*8}p^p!QK66A_m|Gf#;5< TVuggt00000NkvXXu0mjfR@Jg; literal 0 HcmV?d00001 diff --git a/src/ce_editor.pas b/src/ce_editor.pas index baa777b0..f6fd3d97 100644 --- a/src/ce_editor.pas +++ b/src/ce_editor.pas @@ -58,7 +58,6 @@ type MenuItem10: TMenuItem; MenuItem11: TMenuItem; MenuItem12: TMenuItem; - MenuItem13: TMenuItem; MenuItem14: TMenuItem; mnuedPrevWarn: TMenuItem; mnuedNextWarn: TMenuItem; diff --git a/src/ce_synmemo.pas b/src/ce_synmemo.pas index 5997dc8f..86cb3545 100644 --- a/src/ce_synmemo.pas +++ b/src/ce_synmemo.pas @@ -140,17 +140,16 @@ type TSortDialog = class; TGutterIcon = ( - giBulletRed = 0, // breakpoint + giBreakSet = 0, // breakpoint set here giBulletGreen = 1, giBulletBlack = 2, - giBreak = 3, // break point reached + giBreakReached= 3, // break point reached giStep = 4, // step / signal / pause giWatch = 5, // watch point reached - giWarn = 6, // Dscanner result with text hint - giNone = high(byte) // + giWarn = 6 // Dscanner result with text hint ); - const debugTimeGutterIcons = [giBreak, giStep, giWatch]; + const debugTimeGutterIcons = [giBreakReached, giStep, giWatch]; type @@ -843,10 +842,10 @@ begin TextBuffer.AddNotifyHandler(senrUndoRedoAdded, @changeNotify); fImages := TImageList.Create(self); - fImages.AddResourceName(HINSTANCE, 'BULLET_RED'); + fImages.AddResourceName(HINSTANCE, 'BREAK_SET'); fImages.AddResourceName(HINSTANCE, 'BULLET_GREEN'); fImages.AddResourceName(HINSTANCE, 'BULLET_BLACK'); - fImages.AddResourceName(HINSTANCE, 'BREAKS'); + fImages.AddResourceName(HINSTANCE, 'BREAK_REACHED'); fImages.AddResourceName(HINSTANCE, 'STEP'); fImages.AddResourceName(HINSTANCE, 'CAMERA_GO'); fImages.AddResourceName(HINSTANCE, 'WARNING'); @@ -3100,7 +3099,7 @@ procedure TCESynMemo.addBreakPoint(line: integer); begin if findBreakPoint(line) then exit; - addGutterIcon(line, giBulletRed); + addGutterIcon(line, giBreakSet); {$PUSH}{$WARNINGS OFF}{$HINTS OFF} fBreakPoints.Add(pointer(line)); {$POP} @@ -3112,7 +3111,7 @@ procedure TCESynMemo.removeBreakPoint(line: integer); begin if not findBreakPoint(line) then exit; - removeGutterIcon(line, giBulletRed); + removeGutterIcon(line, giBreakSet); {$PUSH}{$WARNINGS OFF}{$HINTS OFF} fBreakPoints.Remove(pointer(line)); {$POP} @@ -3149,10 +3148,7 @@ var begin IncPaintLock; for i:= marks.Count-1 downto 0 do - begin - if TGutterIcon(Marks.Items[i].ImageIndex) in debugTimeGutterIcons then - Marks.Delete(i); - end; + Marks.Items[i].Visible := not (TGutterIcon(Marks.Items[i].ImageIndex) in debugTimeGutterIcons); DecPaintLock; end; @@ -3178,14 +3174,16 @@ var m: TSynEditMarkLine; n: TSynEditMark; i: integer; + s: boolean = false; begin m := Marks.Line[line]; if m.isNotNil then for i := 0 to m.Count-1 do - if m.Items[i].ImageIndex = longint(value) then - exit; - - if value <> giNone then + begin + s := m.Items[i].ImageIndex = longint(value); + m.Items[i].Visible := s; + end; + if not s then begin n:= TSynEditMark.Create(self); n.Line := line; @@ -3254,8 +3252,9 @@ begin caretY := line; EnsureCursorPosVisible; removeDebugTimeMarks; + removeDscannerWarnings; case reason of - dbBreakPoint: addGutterIcon(line, giBreak); + dbBreakPoint: addGutterIcon(line, giBreakReached); dbStep, dbSignal: addGutterIcon(line, giStep); dbWatch: addGutterIcon(line, giWatch); end;