When you select a debug point in the debug point browser, it updates itself according to the target of the selected debug point.
In the case of an AST node, it updates the code presenter (code and highlighting) and updates its layout to display this code presenter:
DebugPointNodeTarget >> updateDebugPointUIManager: aDebugPointUIManager [
aDebugPointUIManager updateCode: self.
aDebugPointUIManager switchToNodeTargetView
]
DebugPointCodePresenter >> updateCode: aDebugPointNodeTarget [
"updates the code window with the code of the selected debug point"
...
self ... ;
addTextSegmentDecoration:
(SpTextPresenterDecorator forHighlight
interval: (aDebugPointNodeTarget node start to: ((aDebugPointNodeTarget node stop) +1));
yourself) .
]
DebugPointBrowserPresenter >> switchToNodeTargetView [
self switchToTargetView: dpCode
]
DebugPointBrowserPresenter >> switchToTargetView: aDebugPointTargetPresenter [
"targetContainer is a SpPanedLayout"
targetContainer replaceSecond: aDebugPointTargetPresenter
]
The method #updateCode: calls the method #addTextSegmentDecoration: that asks an adapter to add highlighting to the corresponding morphs.
However, for an obscure reason, SpPanedLayout>>#replaceSecond: called from DebugPointBrowserPresenter >> switchToNodeTargetView seems to replace the morphs corresponding to the presenter, and thus the highlight that was just added disappears.
To fix that, I just reversed the order of method calls in DebugPointNodeTarget >> updateDebugPointUIManager:.
First, we display the code presenter (which replaces the morphs corresponding to the code presenter) and then we update this code presenter (we add the highlight). In this order, the highlight remains and is correct
Fixes #725
When you select a debug point in the debug point browser, it updates itself according to the target of the selected debug point.
In the case of an AST node, it updates the code presenter (code and highlighting) and updates its layout to display this code presenter:
The method
#updateCode:
calls the method#addTextSegmentDecoration:
that asks an adapter to add highlighting to the corresponding morphs.However, for an obscure reason,
SpPanedLayout>>#replaceSecond:
called fromDebugPointBrowserPresenter >> switchToNodeTargetView
seems to replace the morphs corresponding to the presenter, and thus the highlight that was just added disappears.To fix that, I just reversed the order of method calls in
DebugPointNodeTarget >> updateDebugPointUIManager:
. First, we display the code presenter (which replaces the morphs corresponding to the code presenter) and then we update this code presenter (we add the highlight). In this order, the highlight remains and is correct