Skip to content

Commit

Permalink
Merge pull request #514 from pharo-spec/dev-1.0
Browse files Browse the repository at this point in the history
latest changes
  • Loading branch information
estebanlm authored May 2, 2023
2 parents 16dd8af + 52cb6e5 commit 66b0397
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/NewTools-Inspector/StObjectContextPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ StObjectContextPresenter >> doEvaluateAndGo [
onCompileError: [ ^ self ]
onError: [ :e | e pass ].

activationBlock value: (StEvaluatedSelectionModel newValue: value)
activationBlock value: value
]

{ #category : #private }
Expand Down
20 changes: 10 additions & 10 deletions src/NewTools-Playground/StPlaygroundPagePresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@ StPlaygroundPagePresenter >> doEvaluateAllAndGo [
{ #category : #commands }
StPlaygroundPagePresenter >> doEvaluateAndGo [
| value |

activationBlock ifNil: [ ^ self ].

value := text
value := text
evaluate: text selectedTextOrLine
onCompileError: [ ^ self ]
onError: [ :e | e pass ].

activationBlock value: value
]

Expand Down Expand Up @@ -207,18 +207,16 @@ StPlaygroundPagePresenter >> initializePresenters [
contextKeyBindings: (self menuActionsFor: text) asKMCategory;
whenTextChangedDo: [ :aString | page contents: aString ].

text announcer
when: SpCodeWillBeEvaluatedAnnouncement
text announcer
when: SpCodeWillBeEvaluatedAnnouncement
send: #ensureContentsFlushed
to: self.
text eventHandler

text eventHandler
whenKeyUpDo: [ :event | self updateLineNumber ];
whenMouseUpDo: [ :event | self updateLineNumber ];
"before taking focus position will be nil, ensure I have the correct one"
whenFocusReceivedDo: [ self updateLineNumber ].

self updatePresenter
whenFocusReceivedDo: [ self updateLineNumber ]
]

{ #category : #initialization }
Expand Down Expand Up @@ -396,6 +394,8 @@ StPlaygroundPagePresenter >> updateLineNumber [
{ #category : #initialization }
StPlaygroundPagePresenter >> updatePresenter [

page ifNotNil: [
text text: page contents ].
self updateLineNumber
]

Expand Down
31 changes: 31 additions & 0 deletions src/NewTools-Playground/StPlaygroundScriptPage.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"
This is a special kind of page to point to any script file.
This can be used to extend open a `StPlaygroundPagePresenter`to be used with any script referenced by a `FileReference`.
Example:
```
reference := 'script.st' asFileReference.
(StPlaygroundPagePresenter on: (StPlaygroundScriptPage fromReference: reference)) open
```
"
Class {
#name : #StPlaygroundScriptPage,
#superclass : #StPlaygroundPage,
#instVars : [
'fileReference'
],
#category : #'NewTools-Playground-Model'
}

{ #category : #accessing }
StPlaygroundScriptPage >> fileReference [

^ fileReference
]

{ #category : #initialization }
StPlaygroundScriptPage >> fromReference: aFileReference [

super fromReference: aFileReference.
fileReference := aFileReference
]

0 comments on commit 66b0397

Please sign in to comment.