The Trunk: Morphic-ct.2216.mcz

[email protected] Wed, 1 Jul 2026 10:38:51 0000
Newsgroups gmane.comp.lang.smalltalk.squeak.general
Message-ID <[email protected]>
Christoph Thiede uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.2216.mcz

==================== Summary ====================

Name: Morphic-ct.2216
Author: ct
Time: 1 July 2026, 12:38:50.170043 pm
UUID: eb5a1965-69e2-4c86-8bf0-696fd7370893
Ancestors: Morphic-mt.2215

Fixes delete key in read-only editors.

=============== Diff against Morphic-mt.2215 ===============

Item was changed:
  ----- Method: TextEditor>>forwardDelete: (in category 'typing/selecting keys') -----
  forwardDelete: aKeyboardEvent
  	"Delete forward over the next character.
  	  Make Undo work on the whole type-in, not just the one char.
  	wod 11/3/1998: If there was a selection use #zapSelectionWith: rather than #backspace: which was 'one off' in deleting the selection. Handling of things like undo or typeIn area were not fully considered."
  
  	| startIndex stopIndex |
+ 	morph readOnly ifTrue: [^ false].
- 	morph readOnly ifTrue: [^ self].
  	
  	self hasSelection ifTrue: [
  		"Create checkpoint in history."
  		self replaceSelectionWith: self nullText.
  		^ true].
  
  	startIndex := self markIndex.
  	startIndex > self text size ifTrue: [^ false].
  
  	stopIndex := startIndex.
  
  	"Forward delete next word"
  	self flag: #consistency. "mt: We might want to implemented it like #backspace: and #backWord:."
  	aKeyboardEvent shiftPressed
  		ifTrue: [stopIndex := (self firstWordBoundaryAfter: stopIndex) - 1].
  
  	self selectInvisiblyFrom: startIndex to: stopIndex.
  	
  	self isTypingIn ifTrue: [
  		self history current type = #forwardDelete
  			ifFalse: [self closeTypeIn]
  			ifTrue: [
  				"Append next characters that will be removed."
  				self history current contentsBefore append: self selection.
  				self history current intervalBefore in:  [:i |
  					self history current intervalBefore: (i first to: i last + (stopIndex - startIndex + 1))]]].
  	
  	self openTypeInFor: #forwardDelete.
  	self zapSelectionWith: self nullText.
  	
  	^ false!

Squeak-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]