# HG changeset patch # User Jan Vrany # Date 1399554308 -7200 # Node ID 9510671ea784354b2f4c02e146fbf7136809a7eb # Parent 195c096a4cc8eb60d3a60ab7487d61a0fcc7a8a7 Fixes for breakpoint management when editing the code. diff -r 195c096a4cc8 -r 9510671ea784 Tools__BreakpointService.st --- a/Tools__BreakpointService.st Thu May 08 14:52:16 2014 +0200 +++ b/Tools__BreakpointService.st Thu May 08 15:05:08 2014 +0200 @@ -83,12 +83,6 @@ "Created: / 22-07-2013 / 14:01:17 / cg" ! ! -!BreakpointService methodsFor:'accessing'! - -breakpoints - ^ breakpoints -! ! - !BreakpointService methodsFor:'change & update'! update: aspect with: param from: sender @@ -189,7 +183,7 @@ key == #Accept ifTrue:[ textView undoableDo:[ - BreakpointQuery answer: breakpoints do:[ + BreakpointQuery answer: self breakpoints do:[ textView accept. ]. ]. @@ -198,6 +192,7 @@ ^ false "Created: / 08-05-2014 / 10:42:56 / Jan Vrany " + "Modified: / 08-05-2014 / 13:52:38 / Jan Vrany " ! linesDeletedFrom: start to: end @@ -277,13 +272,32 @@ "Modified (format): / 05-07-2011 / 21:33:23 / cg" ! +breakpoints + "/ Fixup breakpoint positions + self fixupBreakpointPositions. + ^ breakpoints + + "Modified: / 08-05-2014 / 14:02:25 / Jan Vrany " +! + +fixupBreakpointPositions + breakpoints notEmptyOrNil ifTrue:[ + breakpoints do:[:each | + | pos | + + pos := textView characterPositionOfLine: each line col:1. + each position: pos. + ] + ]. + + "Created: / 08-05-2014 / 14:02:25 / Jan Vrany " +! + moveBreakpointsAfterLine:line by: delta - |pos | - breakpoints do:[:bpnt| bpnt line >= line ifTrue:[ - pos := textView characterPositionOfLine:bpnt line + delta col:1. - bpnt position:pos line:(bpnt line + delta). + "/ Note that position will be fixed up in BreakpointService>>breakpoints + bpnt position:nil line:(bpnt line + delta). ] ]. @@ -292,6 +306,7 @@ "Created: / 17-06-2011 / 13:45:22 / Jan Vrany " "Created: / 06-07-2011 / 17:26:30 / jv" "Modified: / 02-08-2012 / 09:27:10 / cg" + "Modified: / 08-05-2014 / 14:01:17 / Jan Vrany " ! recompile @@ -308,6 +323,7 @@ ^self. ] ifFalse:[ "/ prepare to get reachable bpts + self fixupBreakpointPositions. breakpoints do:[:bp | bp isReached:false]. class := oldMethod mclass. @@ -391,8 +407,8 @@ ] "Created: / 05-07-2011 / 21:33:13 / cg" - "Modified: / 18-07-2012 / 10:53:22 / Jan Vrany " "Modified: / 22-07-2013 / 16:00:13 / cg" + "Modified: / 08-05-2014 / 14:03:06 / Jan Vrany " ! setOrToggleBreakpointAtLine:line @@ -627,14 +643,14 @@ !BreakpointService class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointService.st,v 1.46 2014-05-08 11:26:48 vrany Exp $' + ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointService.st,v 1.47 2014-05-08 13:05:08 vrany Exp $' ! version_CVS - ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointService.st,v 1.46 2014-05-08 11:26:48 vrany Exp $' + ^ '$Header: /cvs/stx/stx/libtool/Tools__BreakpointService.st,v 1.47 2014-05-08 13:05:08 vrany Exp $' ! version_SVN - ^ '$Id: Tools__BreakpointService.st,v 1.46 2014-05-08 11:26:48 vrany Exp $' + ^ '$Id: Tools__BreakpointService.st,v 1.47 2014-05-08 13:05:08 vrany Exp $' ! !