Skip to content

Commit

Permalink
Live elements save on addition + SBWatch call typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeAtHPI committed Jan 17, 2024
1 parent 1988a47 commit 1eec393
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/Sandblocks-Babylonian/SBExample.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ SBExample class >> newFor: aMessage [
{ #category : #'as yet unclassified' }
SBExample class >> registerShortcuts: aProvider [

aProvider registerShortcut: $q command do: #wrapWithExampleWatch
aProvider registerShortcut: $w command do: #wrapWithExampleWatch
]

{ #category : #'as yet unclassified' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SBStGrammarHandler >> addExample: anExample [

anExample startRunning.
self block sandblockEditor select: anExample nameBlock.
self block sandblockEditor save: method tryFixing: true quick: false.
]

{ #category : #'*Sandblocks-Babylonian' }
Expand Down
4 changes: 3 additions & 1 deletion packages/Sandblocks-Core/SBGrammarHandler.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ SBGrammarHandler >> watchWith: aWatchClass [
self block sandblockEditor do: (SBWrapCommand new
outer: aWatchClass new newIdentifier;
inner: self block;
wrap: [:outer :inner | outer expression: inner])
wrap: [:outer :inner | outer expression: inner]).

self block sandblockEditor save: self block containingArtefact tryFixing: true quick: false.
]

{ #category : #'callback helpers' }
Expand Down
10 changes: 8 additions & 2 deletions packages/Sandblocks-Smalltalk/SBStGrammarHandler.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,10 @@ SBStGrammarHandler >> wrapInOptionalVariant [
named: inner printString
alternatives: (self defaultOptionalAlternativesForBlocks: inner)
activeIndex: 2];
yourself]
yourself].
variant sandblockEditor select: variant nameBlock.
variant sandblockEditor save: variant containingArtefact tryFixing: true quick: false.
]
{ #category : #actions }
Expand Down Expand Up @@ -666,7 +669,10 @@ SBStGrammarHandler >> wrapInVariant [
named: inner printString
alternatives: (self defaultAlternativesForBlocks: inner)
activeIndex: 2];
yourself]
yourself].
variant sandblockEditor select: variant nameBlock.
variant sandblockEditor save: variant containingArtefact tryFixing: true quick: false.
]
{ #category : #actions }
Expand Down
12 changes: 2 additions & 10 deletions packages/Sandblocks-Smalltalk/SBVariant.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ SBVariant >> beActive [
ifNil: [command do]
ifNotNil:[:theEditor | theEditor do: command].

self saveArtefact.
self containingArtefact sandblockEditor save: self containingArtefact tryFixing: true quick: false.
]

{ #category : #actions }
Expand All @@ -236,7 +236,7 @@ SBVariant >> beInactive [
ifNil: [command do]
ifNotNil:[:theEditor | theEditor do: command].

self saveArtefact.
self containingArtefact sandblockEditor save: self containingArtefact tryFixing: true quick: false.
]

{ #category : #accessing }
Expand Down Expand Up @@ -419,14 +419,6 @@ SBVariant >> replaceValuesFrom: anotherVariant [
self named: anotherVariant name alternatives: anotherVariant alternatives activeIndex: anotherVariant activeIndex
]

{ #category : #actions }
SBVariant >> saveArtefact [

self containingArtefact save.
self containingArtefact sandblockEditor ifNotNil: [:theEditor | theEditor markSaved: self containingArtefact]

]

{ #category : #accessing }
SBVariant >> statementsFor: aNamedBlock [

Expand Down
2 changes: 1 addition & 1 deletion packages/Sandblocks-Watch/SBWatchView.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ SBWatchView >> printOn: aStream [
{ #category : #actions }
SBWatchView >> reportValue: anObject [

self reportValue: {anObject} sized: SBMorphResizer newIdentity
self reportValues: {anObject} sized: SBMorphResizer newIdentity
]

{ #category : #actions }
Expand Down

0 comments on commit 1eec393

Please sign in to comment.