A new version of OcompletionSqueakCompatibility was added to project The Inbox: http://source.squeak.org/inbox/OcompletionSqueakCompatibility-mad.4.mcz
==================== Summary ====================
Name: OcompletionSqueakCompatibility-mad.4 Author: mad Time: 22 September 2023, 4:41:48.24935 pm UUID: b361db4b-3e6f-48b0-bdd2-3527680ea77c Ancestors: OcompletionSqueakCompatibility-JohnMcKeon.3
Fixes the position of the OMenuMorph for (Pluggable)TextMorphs inside TransformMorphs.
I know this doesn't belong to trunk, could someone please merge this into OCompletion? Thank you.
==================== Snapshot ====================
SystemOrganization addCategory: #OcompletionSqueakCompatibility!
StandardToolSet subclass: #ECToolSet instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OcompletionSqueakCompatibility'!
----- Method: ECToolSet class>>codeCompletionAround:textMorph:keyStroke: (in category 'completion') ----- codeCompletionAround: aBlock textMorph: aTextMorph keyStroke: evt | completionAllowed editor stringHolder | editor := aTextMorph editor. stringHolder := editor ifNotNil: [editor model].
completionAllowed := ECPreferences enabled and:[ ECController allowModel: stringHolder ]. completionAllowed ifTrue: [(stringHolder completionController handleKeystrokeBefore: evt editor: editor) ifTrue: [^ self]]. aBlock value. "sends to keyStroke event handler, if any" "Narrow the completion with any of the keys" completionAllowed ifTrue: [stringHolder completionController handleKeystrokeAfter: evt editor: editor]!
----- Method: ECToolSet class>>register (in category 'initialization') ----- register "Asks the system to use me when launching completion" ToolSet register: self!
----- Method: SmalltalkEditor>>isCaretBehindChar (in category '*OcompletionSqueakCompatibility') ----- isCaretBehindChar "Return true if the cursor position is after an alphanumeric character, otherwise false."
| cursorPosition | ^(cursorPosition := self startIndex) >= 2 and: [ (self text at: cursorPosition - 1) isAlphaNumeric ]!
----- Method: SmalltalkEditor>>selectionPosition: (in category '*OcompletionSqueakCompatibility') ----- selectionPosition: aString
| startIndex | startIndex := self startIndex. ^[ | bottomLeft topLeft index | index := startIndex - aString size. self selectInvisiblyFrom: index to: index - 1. bottomLeft := paragraph selectionRects first bottomLeft. topLeft := self morph boundsInWorld topLeft. topLeft + bottomLeft ] ensure: [ self selectInvisiblyFrom: startIndex to: startIndex - 1 ]!
----- Method: SmalltalkEditor>>wordAtCaret (in category '*OcompletionSqueakCompatibility') ----- wordAtCaret ^paragraph text asString wordBefore: self startIndex - 1 !
----- Method: ParagraphEditor>>isCaretBehindChar (in category '*OcompletionSqueakCompatibility') ----- isCaretBehindChar "Return true if the cursor position is after an alphanumeric character, otherwise false."
| cursorPosition | ^(cursorPosition := self startIndex) >= 2 and: [ (self text at: cursorPosition - 1) isAlphaNumeric ]!
----- Method: ParagraphEditor>>selectionPosition: (in category '*OcompletionSqueakCompatibility') ----- selectionPosition: aString
| startIndex | startIndex := self startIndex. ^[ | bottomLeft topLeft index | index := startIndex - aString size. self selectInvisiblyFrom: index to: index - 1. bottomLeft := paragraph selectionRects first bottomLeft. topLeft := self morph boundsInWorld topLeft. topLeft + bottomLeft ] ensure: [ self selectInvisiblyFrom: startIndex to: startIndex - 1 ]!
----- Method: ParagraphEditor>>wordAtCaret (in category '*OcompletionSqueakCompatibility') ----- wordAtCaret ^paragraph text asString wordBefore: self startIndex - 1 !
Hi Levente, Eliot,
could one of you maybe merge OcompletionSqueakCompatibility-mad.4.mcz from the inbox into the OCompletion package? I have worked with Marius (mad) on this patch and am pretty confident that we chose the right Morphic interface.
Thanks in advance!
Best, Christoph
PS: Below is the actual diff of the patch:
=============== Diff against OcompletionSqueakCompatibility-JohnMcKeon.3 ===============
ParagraphEditor>>selectionPosition: {*OcompletionSqueakCompatibility} · mad 9/22/2023 16:32 (changed) selectionPosition: aString
| startIndex | startIndex := self startIndex. ^[ | bottomLeft topLeft index | index := startIndex - aString size. self selectInvisiblyFrom: index to: index - 1. bottomLeft := paragraph selectionRects first bottomLeft. - topLeft := self morph owner submorphBounds topLeft. + topLeft := self morph boundsInWorld topLeft. topLeft + bottomLeft ] ensure: [ self selectInvisiblyFrom: startIndex to: startIndex - 1 ]
SmalltalkEditor>>selectionPosition: {*OcompletionSqueakCompatibility} · mad 9/22/2023 16:30 (changed) selectionPosition: aString
| startIndex | startIndex := self startIndex. ^[ | bottomLeft topLeft index | index := startIndex - aString size. self selectInvisiblyFrom: index to: index - 1. bottomLeft := paragraph selectionRects first bottomLeft. - topLeft := self morph owner submorphBounds topLeft. + topLeft := self morph boundsInWorld topLeft. topLeft + bottomLeft ] ensure: [ self selectInvisiblyFrom: startIndex to: startIndex - 1 ]
PPS: Levente: I tried to send you a private message but got a 550 5.4.1 Recipient address rejected: Access denied ...
--- Sent from Squeak Inbox Talk
On 2023-09-22T14:41:48+00:00, commits@source.squeak.org wrote:
A new version of OcompletionSqueakCompatibility was added to project The Inbox: http://source.squeak.org/inbox/OcompletionSqueakCompatibility-mad.4.mcz
==================== Summary ====================
Name: OcompletionSqueakCompatibility-mad.4 Author: mad Time: 22 September 2023, 4:41:48.24935 pm UUID: b361db4b-3e6f-48b0-bdd2-3527680ea77c Ancestors: OcompletionSqueakCompatibility-JohnMcKeon.3
Fixes the position of the OMenuMorph for (Pluggable)TextMorphs inside TransformMorphs.
I know this doesn't belong to trunk, could someone please merge this into OCompletion? Thank you.
==================== Snapshot ====================
SystemOrganization addCategory: #OcompletionSqueakCompatibility!
StandardToolSet subclass: #ECToolSet instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'OcompletionSqueakCompatibility'!
----- Method: ECToolSet class>>codeCompletionAround:textMorph:keyStroke: (in category 'completion') ----- codeCompletionAround: aBlock textMorph: aTextMorph keyStroke: evt | completionAllowed editor stringHolder | editor := aTextMorph editor. stringHolder := editor ifNotNil: [editor model].
completionAllowed := ECPreferences enabled and:[ ECController allowModel: stringHolder ]. completionAllowed ifTrue: [(stringHolder completionController handleKeystrokeBefore: evt editor: editor) ifTrue: [^ self]]. aBlock value. "sends to keyStroke event handler, if any" "Narrow the completion with any of the keys" completionAllowed ifTrue: [stringHolder completionController handleKeystrokeAfter: evt editor: editor]!
----- Method: ECToolSet class>>register (in category 'initialization') ----- register "Asks the system to use me when launching completion" ToolSet register: self!
----- Method: SmalltalkEditor>>isCaretBehindChar (in category '*OcompletionSqueakCompatibility') ----- isCaretBehindChar "Return true if the cursor position is after an alphanumeric character, otherwise false."
| cursorPosition | ^(cursorPosition := self startIndex) >= 2 and: [ (self text at: cursorPosition - 1) isAlphaNumeric ]!
----- Method: SmalltalkEditor>>selectionPosition: (in category '*OcompletionSqueakCompatibility') ----- selectionPosition: aString
| startIndex | startIndex := self startIndex. ^[ | bottomLeft topLeft index | index := startIndex - aString size. self selectInvisiblyFrom: index to: index - 1. bottomLeft := paragraph selectionRects first bottomLeft. topLeft := self morph boundsInWorld topLeft. topLeft + bottomLeft ] ensure: [ self selectInvisiblyFrom: startIndex to: startIndex - 1 ]!
----- Method: SmalltalkEditor>>wordAtCaret (in category '*OcompletionSqueakCompatibility') ----- wordAtCaret ^paragraph text asString wordBefore: self startIndex - 1 !
----- Method: ParagraphEditor>>isCaretBehindChar (in category '*OcompletionSqueakCompatibility') ----- isCaretBehindChar "Return true if the cursor position is after an alphanumeric character, otherwise false."
| cursorPosition | ^(cursorPosition := self startIndex) >= 2 and: [ (self text at: cursorPosition - 1) isAlphaNumeric ]!
----- Method: ParagraphEditor>>selectionPosition: (in category '*OcompletionSqueakCompatibility') ----- selectionPosition: aString
| startIndex | startIndex := self startIndex. ^[ | bottomLeft topLeft index | index := startIndex - aString size. self selectInvisiblyFrom: index to: index - 1. bottomLeft := paragraph selectionRects first bottomLeft. topLeft := self morph boundsInWorld topLeft. topLeft + bottomLeft ] ensure: [ self selectInvisiblyFrom: startIndex to: startIndex - 1 ]!
----- Method: ParagraphEditor>>wordAtCaret (in category '*OcompletionSqueakCompatibility') ----- wordAtCaret ^paragraph text asString wordBefore: self startIndex - 1 !
squeak-dev@lists.squeakfoundation.org