From 6879034635d898e9189e2ef8785718dc25eeb8cd Mon Sep 17 00:00:00 2001 From: Tom Beckmann Date: Wed, 9 Aug 2023 10:23:03 +0200 Subject: [PATCH] st: fix editing setup in morphexample; core: allow changing contents of suggestion items --- packages/Sandblocks-Core/SBSuggestionItem.class.st | 1 + packages/Sandblocks-Smalltalk/SBStGrammarHandler.class.st | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/Sandblocks-Core/SBSuggestionItem.class.st b/packages/Sandblocks-Core/SBSuggestionItem.class.st index 080b92d0..c0951691 100644 --- a/packages/Sandblocks-Core/SBSuggestionItem.class.st +++ b/packages/Sandblocks-Core/SBSuggestionItem.class.st @@ -192,6 +192,7 @@ SBSuggestionItem >> selector: aString label: anotherString [ | container | container := self firstSubmorph. + container removeAllMorphs. selector := aString. label := anotherString. container addMorphBack: (SBStringMorph new diff --git a/packages/Sandblocks-Smalltalk/SBStGrammarHandler.class.st b/packages/Sandblocks-Smalltalk/SBStGrammarHandler.class.st index 469e2644..c67371c7 100644 --- a/packages/Sandblocks-Smalltalk/SBStGrammarHandler.class.st +++ b/packages/Sandblocks-Smalltalk/SBStGrammarHandler.class.st @@ -495,7 +495,7 @@ SBStGrammarHandler >> wrapInMessageSend: aString [ | msg | self block isExpression ifFalse: [^ self]. msg := self class messageSendClass new - receiver: (self block newNullBlock label: 'expr') + receiver: (self newNullBlock label: 'expr') selector: aString arguments: (aString numArgs > 0 ifTrue: [(1 to: aString numArgs) collect: [:i | self block newNullBlock label: 'arg']]