[squeak-dev] The Trunk: Morphic-mt.1981.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue May 3 14:26:45 UTC 2022
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1981.mcz
==================== Summary ====================
Name: Morphic-mt.1981
Author: mt
Time: 3 May 2022, 4:26:34.106894 pm
UUID: 5038458d-6bf5-2649-bcc8-afcd2468c9b2
Ancestors: Morphic-mt.1980
Makes having LF as a word-by-word boundary more robust.
Thanks to Nicolas (nice) and Tobias (topa) for pointing this out!
=============== Diff against Morphic-mt.1980 ===============
Item was changed:
TextEditor subclass: #SmalltalkEditor
instanceVariableNames: ''
+ classVariableNames: 'WordBoundariesBackward WordBoundariesForward'
- classVariableNames: ''
poolDictionaries: ''
category: 'Morphic-Text Support'!
!SmalltalkEditor commentStamp: 'jmv 8/8/2009 15:10' prior: 0!
The editor built specifically for Smalltalk code!
Item was changed:
+ ----- Method: SmalltalkEditor class>>initialize (in category 'class initialization') -----
- ----- Method: SmalltalkEditor class>>initialize (in category 'keyboard shortcut tables') -----
initialize
"SmalltalkEditor initialize"
+
self initializeCmdKeyShortcuts.
self initializeShiftCmdKeyShortcuts.
self initializeYellowButtonMenu.
self initializeShiftedYellowButtonMenu.
+
+ self initializeWordBoundaries.!
- !
Item was added:
+ ----- Method: SmalltalkEditor class>>initializeWordBoundaries (in category 'class initialization') -----
+ initializeWordBoundaries
+ "
+ self initializeWordBoundaries.
+ "
+
+ WordBoundariesBackward := '([{''"|^.',
+ String space,
+ Character nbsp asString,
+ String tab,
+ String cr,
+ String lf.
+
+ WordBoundariesForward := ')]}''"|^.',
+ String space,
+ Character nbsp asString,
+ String tab,
+ String cr,
+ String lf.!
Item was changed:
----- Method: SmalltalkEditor>>nextWord: (in category 'private') -----
nextWord: position
| string index boundaryCharacters |
string := self string.
index := position - 1.
[ (index
between: 1
and: string size) and: [ (string at: index) isSeparator ] ] whileTrue: [ index := index + 1 ].
+ boundaryCharacters := WordBoundariesForward.
+
- boundaryCharacters := ')]}''"|^.
- '.
-
((index
between: 1
and: string size) and: [ boundaryCharacters includes: (string at: index) ])
ifTrue:
[ index := index + 1 ]
ifFalse:
[ [ (index
between: 1
and: string size) and: [ (boundaryCharacters includes: (string at: index)) not ] ] whileTrue: [ index := index + 1 ] ].
^ index!
Item was changed:
----- Method: SmalltalkEditor>>previousWord: (in category 'private') -----
previousWord: position
| string index boundaryCharacters |
string := self string.
index := position.
"First, get out of whitespace."
[ (index
between: 2
and: string size) and: [ (string at: index) isSeparator ] ] whileTrue: [ index := index - 1 ].
+ boundaryCharacters := WordBoundariesBackward.
+
- boundaryCharacters := '([{''"|^.
- '.
-
"Are we at a boundary character?"
((index
between: 2
and: string size) and: [ boundaryCharacters includes: (string at: index) ])
ifTrue:
[ "yes, select it and any following whitespace of this line."
index := index - 1 ]
ifFalse:
[ "no, select to the next boundary character"
[ (index
between: 1
and: string size) and: [ (boundaryCharacters includes: (string at: index)) not ] ] whileTrue: [ index := index - 1 ] ].
^ index + 1!
More information about the Squeak-dev
mailing list
|