diff --git a/src/GToolkit-Debugger/GtAbstractExpandableDebuggerElement.class.st b/src/GToolkit-Debugger/GtAbstractExpandableDebuggerElement.class.st index d55e657f..6bfcdef2 100644 --- a/src/GToolkit-Debugger/GtAbstractExpandableDebuggerElement.class.st +++ b/src/GToolkit-Debugger/GtAbstractExpandableDebuggerElement.class.st @@ -54,6 +54,11 @@ GtAbstractExpandableDebuggerElement >> actOnSelectedContextChangedFor: aContext addChild: detailsTabGroupElement as: #detailsElement ] +{ #category : #callbacks } +GtAbstractExpandableDebuggerElement >> actOnSelectedContextChangedWithoutFocusChangeFor: aContext [ + "No action needed at the moment" +] + { #category : #'building widgets' } GtAbstractExpandableDebuggerElement >> buildContextVariablesElement [ | contextVariablesElement | diff --git a/src/GToolkit-Debugger/GtAbstractExpandableStackElement.class.st b/src/GToolkit-Debugger/GtAbstractExpandableStackElement.class.st index 74fbd670..9775b106 100644 --- a/src/GToolkit-Debugger/GtAbstractExpandableStackElement.class.st +++ b/src/GToolkit-Debugger/GtAbstractExpandableStackElement.class.st @@ -137,7 +137,8 @@ GtAbstractExpandableStackElement >> openFirstNonFilteredContextFrom: aStream [ itemSuchThat: [ :eachCoder | (self shouldJumpOverCoverViewModel: eachCoder) not ] do: [ :anIndex :isSynchronous | | anAction | - anAction := [ self stackFramesList itemsProvider: anItemsProvider. + anAction := [ + self stackFramesList itemsProvider: anItemsProvider. self stackFramesList scrollToIndex: anIndex offset: 0. self selectCoderUIModel: (anItemsProvider itemAt: anIndex) ]. @@ -188,7 +189,13 @@ GtAbstractExpandableStackElement >> selectCoderUIModel: aContextCoderUIModel [ selectedCoderUIModel := aContextCoderUIModel. selectedCoderUIModel expanded: true. - selectedCoderUIModel focused: true. + selectedCoderUIModel focused + ifFalse: [ selectedCoderUIModel focused: true ] + ifTrue: [ + "We do not give the focus in case the coder view model has the focus. + Instead we notify the debugger that the current coder was selected without changing the focus" + self debuggerElementDo: [ :aDebuggerElement | + aDebuggerElement actOnSelectedContextChangedWithoutFocusChangeFor: selectedCoderUIModel coder context ] ]. "Update the source code as some actions (for example save) can change the compiled method stored in the context." diff --git a/src/GToolkit-Debugger/GtDebuggerAbstractStackModel.class.st b/src/GToolkit-Debugger/GtDebuggerAbstractStackModel.class.st index 5a7cae2e..74d05819 100644 --- a/src/GToolkit-Debugger/GtDebuggerAbstractStackModel.class.st +++ b/src/GToolkit-Debugger/GtDebuggerAbstractStackModel.class.st @@ -33,7 +33,8 @@ GtDebuggerAbstractStackModel >> cachedCodersDo: aBlock [ { #category : #accessing } GtDebuggerAbstractStackModel >> coderViewModelStream [ ^ self contextStream - map: [ :eachContext | (self createCoderFor: eachContext in: session) asCoderViewModel] + map: [ :eachContext | + (self createCoderFor: eachContext in: session) asCoderViewModel ] cache: coderViewModelCache ]