[squeak-dev] The Trunk: Morphic-mt.1812.mcz
Eliot Miranda
eliot.miranda at gmail.com
Tue Dec 14 22:05:49 UTC 2021
Hi Marcel,
On Sat, Dec 4, 2021 at 3:26 AM <commits at source.squeak.org> wrote:
> Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
> http://source.squeak.org/trunk/Morphic-mt.1812.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-mt.1812
> Author: mt
> Time: 4 December 2021, 12:26:07.860493 pm
> UUID: 89876df1-baaa-314b-9274-bc585d62f388
> Ancestors: Morphic-mt.1811
>
> Removes US-layout specific keyboard shortcuts for 'Enclose selection' in
> favor of the cross-platform compatible preference 'Enclose selection with
> brackets'. Just type the bracket character like you would in normal text
> editing. No extra shortcut to remember.
>
> Note that the "replace expression" operation needs an extra Del/Backspace
> hit if "Enclose selection with brackets" is enabled (by default).
>
> Note that dead keys might be an issue when the second key press yields two
> characters, which effectively toggles the brackets around the selection
> twice. I did observe that with the single-quote/double-quote key in an
> US-layout on Windows 10.
>
So how do I enclose the selection with brackets now? I can't see how to do
it at all. I have no "enclose" preferences set.
Also, if I select something in a class definition in a browser, type
Command-9 I get "MessageNotUnderstood: TextKern>>turnOff.
Frustratedly...
> =============== Diff against Morphic-mt.1811 ===============
>
> Item was changed:
> ----- Method: TextEditor class>>encloseSelection (in category
> 'preferences') -----
> encloseSelection
> <preference: 'Enclose selection with brackets () {} [] '''' "" ||
> <>'
> categoryList: #('Morphic' 'editing')
> description: 'When true, selecting text and typing an
> opening parenthesis, bracket, square-bracket, single quote, or double quote
> will add corresponding character around the selection without requiring a
> cmd key.'
> type: #Boolean>
>
> + ^ EncloseSelection ifNil: [ true ]!
> - ^ EncloseSelection ifNil: [ false ]!
>
> Item was changed:
> ----- Method: TextEditor class>>initializeCmdKeyShortcuts (in category
> 'keyboard shortcut tables') -----
> initializeCmdKeyShortcuts
> "Initialize the (unshifted) command-key (or alt-key) shortcut
> table."
>
> "NOTE: if you don't know what your keyboard generates, use Sensor
> kbdTest"
>
> "TextEditor initialize"
>
> | cmdMap cmds |
> cmdMap := Array new: 256 withAll: #noop:. "use temp
> in case of a crash"
> cmdMap at: 1 + 1 put: #cursorHome:.
> "home key"
> cmdMap at: 4 + 1 put: #cursorEnd:.
> "end key"
> cmdMap at: 8 + 1 put: #backspace:.
> "ctrl-H or delete key"
> cmdMap at: 11 + 1 put: #cursorPageUp:. "page up
> key"
> cmdMap at: 12 + 1 put: #cursorPageDown:. "page down
> key"
> cmdMap at: 13 + 1 put: #crWithIndent:.
> "cmd-Return"
> cmdMap at: 27 + 1 put: #offerMenuFromEsc:. "escape
> key"
> cmdMap at: 28 + 1 put: #cursorLeft:.
> "left arrow key"
> cmdMap at: 29 + 1 put: #cursorRight:.
> "right arrow key"
> cmdMap at: 30 + 1 put: #cursorUp:.
> "up arrow key"
> cmdMap at: 31 + 1 put: #cursorDown:.
> "down arrow key"
> cmdMap at: 32 + 1 put: #selectWord:.
> "space bar key"
> cmdMap at: 127 + 1 put: #forwardDelete:. "del key"
>
> '0123456789-='
> do: [:char | cmdMap at: char asciiValue + 1 put:
> #changeEmphasis:].
> -
> - '([<{|"''' do: [:char | cmdMap at: char asciiValue + 1 put:
> #enclose:].
>
> cmds := #($a #selectAll: $c #copySelection: $e #exchange: $f
> #find: $g #findAgain: $j #doAgain: $k #offerFontMenu: $u #align: $v #paste:
> $w #backWord: $x #cut: $y #swapChars: $z #undo:).
> 1 to: cmds size
> by: 2
> do: [:i | cmdMap at: (cmds at: i) asciiValue + 1 put:
> (cmds at: i + 1)].
>
> cmdActions := cmdMap!
>
> Item was changed:
> ----- Method: TextEditor class>>initializeShiftCmdKeyShortcuts (in
> category 'keyboard shortcut tables') -----
> initializeShiftCmdKeyShortcuts
> "Initialize the shift-command-key (or control-key) shortcut table."
> "NOTE: if you don't know what your keyboard generates, use Sensor
> kbdTest"
> "wod 11/3/1998: Fix setting of cmdMap for shifted keys to actually
> use the
> capitalized versions of the letters.
> TPR 2/18/99: add the plain ascii values back in for those VMs that
> don't return the shifted values."
>
> "TextEditor initialize"
>
> | cmdMap cmds |
>
> "shift-command and control shortcuts"
> cmdMap := Array new: 256 withAll: #noop:. "use temp
> in case of a crash"
> cmdMap at: ( 1 + 1) put: #cursorHome:. "home key"
> cmdMap at: ( 4 + 1) put: #cursorEnd:.
> "end key"
> cmdMap at: ( 8 + 1) put: #forwardDelete:.
> "ctrl-H or delete key"
> cmdMap at: (11 + 1) put: #cursorPageUp:.
> "page up key"
> cmdMap at: (12 + 1) put: #cursorPageDown:. "page down
> key"
> cmdMap at: (13 + 1) put: #crWithIndent:.
> "ctrl-Return"
> cmdMap at: (27 + 1) put: #offerMenuFromEsc:. "escape key"
> cmdMap at: (28 + 1) put: #cursorLeft:. "left
> arrow key"
> cmdMap at: (29 + 1) put: #cursorRight:. "right
> arrow key"
> cmdMap at: (30 + 1) put: #cursorUp:.
> "up arrow key"
> cmdMap at: (31 + 1) put: #cursorDown:. "down
> arrow key"
> cmdMap at: (32 + 1) put: #selectWord:. "space bar
> key"
> cmdMap at: (45 + 1) put: #changeEmphasis:.
> "cmd-sh-minus"
> cmdMap at: (61 + 1) put: #changeEmphasis:.
> "cmd-sh-plus"
> cmdMap at: (127 + 1) put: #forwardDelete:. "del key"
>
> - "On some keyboards, these characters require a shift"
> - '([<{|"''9' do: [:char | cmdMap at: char asciiValue + 1 put:
> #enclose:].
> -
> - "NB: sw 12/9/2001 commented out the idiosyncratic line just below,
> which was grabbing shift-esc in the text editor and hence which argued with
> the wish to have shift-esc be a universal gesture for escaping the local
> context and calling up the desktop menu."
> - "cmdMap at: (27 + 1) put: #shiftEnclose:." "ctrl-["
> -
> - "'""''(' do: [ :char | cmdMap at: (char asciiValue + 1) put:
> #enclose:]."
> -
> cmds := #(
> $c compareToClipboard:
> $h cursorTopHome:
> $j doAgainUpToEnd:
> $k changeStyle:
> $m selectCurrentTypeIn:
> $s findAgain:
> $u changeLfToCr:
> $x makeLowercase:
> $y makeUppercase:
> $z redo: "makeCapitalized:"
> ).
> 1 to: cmds size by: 2 do: [ :i |
> cmdMap at: ((cmds at: i) asciiValue + 1) put: (cmds at: i
> + 1). "plain keys"
> cmdMap at: ((cmds at: i) asciiValue - 32 + 1) put: (cmds
> at: i + 1). "shifted keys"
> cmdMap at: ((cmds at: i) asciiValue - 96 + 1) put: (cmds
> at: i + 1). "ctrl keys"
> ].
> shiftCmdActions := cmdMap!
>
> Item was changed:
> ----- Method: TextEditor>>enclose: (in category 'editing keys') -----
> enclose: aKeyboardEvent
> "Insert or remove bracket characters around the current selection."
>
> | character left right startIndex stopIndex oldSelection which t |
> + character := aKeyboardEvent keyCharacter.
> - character := aKeyboardEvent shiftPressed
> - ifTrue: ['{}|"<>' at: ('[]\'',.'
> indexOf: aKeyboardEvent keyCharacter) ifAbsent: [aKeyboardEvent
> keyCharacter]]
> - ifFalse: [aKeyboardEvent
> keyCharacter].
> self closeTypeIn.
> startIndex := self startIndex.
> stopIndex := self stopIndex.
> oldSelection := self selection.
> + which := '([<{|"''' indexOf: character ifAbsent: [ ^ false ].
> + left := '([<{|"''' at: which.
> + right := ')]>}|"''' at: which.
> - which := '([<{|"''9' indexOf: character ifAbsent: [ ^ false ].
> - "Allow Control key in lieu of Alt+Shift for (, {, and
> double-quote."
> - left := ((Preferences cmdKeysInText and: [ aKeyboardEvent
> controlKeyPressed ])
> - ifTrue: [ '({<{|""(' ]
> - ifFalse: ['([<{|"''(']) at: which.
> - right := ((Preferences cmdKeysInText and: [ aKeyboardEvent
> controlKeyPressed ])
> - ifTrue: [ ')}>}|"")' ]
> - ifFalse: [')]>}|"'')']) at: which.
> t := self text.
> ((startIndex > 1 and: [stopIndex <= t size])
> and: [ (t at: startIndex-1) = left and: [(t at:
> stopIndex) = right]])
> ifTrue:
> ["already enclosed; strip off brackets"
> self selectFrom: startIndex-1 to: stopIndex.
> self replaceSelectionWith: oldSelection]
> ifFalse:
> ["not enclosed; enclose by matching brackets"
> self replaceSelectionWith:
> (Text string: (String with: left),
> oldSelection string, (String with: right) attributes: emphasisHere).
> self selectFrom: startIndex+1 to: stopIndex].
> ^true!
>
> Item was changed:
> + (PackageInfo named: 'Morphic') postscript: 'Editor initialize. "Removes
> US-layout specific keyboard shortcuts for ''Enclose selection'' in favor of
> the cross-platform compatible preference ''Enclose selection with
> brackets''."'!
> - (PackageInfo named: 'Morphic') postscript: 'SystemProgressMorph reset.
> "New layer number"
> -
> - "Morphic-ct.1796 - Inverts the preference ''halo encloses full bounds''
> by pressing the control key while invocating a halo."
> - (Preferences preferenceAt: #haloEnclosesFullBounds) instVarNamed:
> ''helpString'' put: ''If enabled, halos will enclose the full bounds of the
> target morph, rather than just the bounds. You can also invert this
> behavior temporarily by holding down Ctrl while invoking a halo on a
> morph.''.'!
>
>
>
--
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211214/f28752c0/attachment.html>
More information about the Squeak-dev
mailing list
|