Skip to content

Commit

Permalink
Merge pull request #518 from pharo-spec/Pharo11
Browse files Browse the repository at this point in the history
Pharo11 fixes
  • Loading branch information
estebanlm authored May 16, 2023
2 parents decdb68 + f2de548 commit 2d8fa7b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 12 deletions.
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
]
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ StWorldMenuProcessorTest >> processor [
StWorldMenuProcessorTest >> testEmptyQueryShowsResults [

self runForText: ''.
self assertResultsIncludesMenuEntry: 'Iceberg'.
self assertResultsIncludesMenuEntry: 'Spotter'.

]

Expand Down
2 changes: 1 addition & 1 deletion src/NewTools-Spotter/StSpotter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ StSpotter class >> initialize [
{ #category : #settings }
StSpotter class >> insertsSelection [

^ InsertsSelection ifNil: [ InsertsSelection := true ]
^ InsertsSelection ifNil: [ InsertsSelection := false ]
]

{ #category : #settings }
Expand Down

0 comments on commit 2d8fa7b

Please sign in to comment.