[squeak-dev] The Trunk: Morphic-mt.1243.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Aug 8 07:53:07 UTC 2016


Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1243.mcz

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

Name: Morphic-mt.1243
Author: mt
Time: 8 August 2016, 9:52:32.572588 am
UUID: 31d9bb2c-58ef-c948-81c3-5ac5f150477f
Ancestors: Morphic-mt.1242

Two other bug fixes for query-symbols in text editors.

=============== Diff against Morphic-mt.1242 ===============

Item was changed:
  ----- Method: TextEditor>>querySymbol: (in category 'typing/selecting keys') -----
  querySymbol: aKeyboardEvent
  	"Invoked by Ctrl-q to query the Symbol table and display alternate symbols."
  
  	| hintText lastOffering offering |
+ 	(self isTypingIn not or: [self history current type ~= #query])
- 	self isTypingIn
- 		ifFalse: [
- 			self selectPrecedingIdentifier.
- 			hintText := self selection string]
  		ifTrue: [
+ 			self closeTypeIn.
+ 			self openTypeIn.
+ 			self selectPrecedingIdentifier.
+ 			self closeTypeIn].
+ 	
+ 	self openTypeInFor: #query.
+ 	
+ 	hintText := self history current contentsBefore string.
+ 	hintText := hintText copyFrom: (hintText
+ 		lastIndexOfAnyOf: Character separators, '#'
+ 		startingAt: hintText size ifAbsent: [0])+1 to: hintText size.
+ 	self selectInvisiblyFrom: self history current intervalBefore first to: self stopIndex-1.
+ 	lastOffering := self selection string.
+ 	lastOffering := (lastOffering copyReplaceAll: ':  ' with: ':') withBlanksTrimmed.
+ 
+ 	"Only offer suggestions for not-empty tokens."
+ 	hintText ifEmpty: [morph flash. self closeTypeIn. ^ true].
- 			self history current type = #query
- 				ifFalse: [
- 					self closeTypeIn.
- 					self selectPrecedingIdentifier.
- 					hintText := self selection string]
- 				ifTrue: [		
- 					self history hasPrevious
- 						ifFalse: [morph flash. self closeTypeIn. ^ true].
- 					hintText := self history previous contentsAfter string.
- 					hintText := hintText copyFrom: (hintText
- 						lastIndexOfAnyOf: Character separators, '#'
- 						startingAt: hintText size ifAbsent: [0])+1 to: hintText size.
- 					self selectInvisiblyFrom: self history current intervalBefore first to: self stopIndex-1.
- 					lastOffering := self selection string.
- 					lastOffering := (lastOffering copyReplaceAll: ':  ' with: ':') withBlanksTrimmed.]].
- 		
  	offering := (Symbol thatStarts: hintText skipping: lastOffering) ifNil: [hintText].
+ 	offering ifEmpty: [morph flash. self closeTypeIn. ^ true].
+ 	
+ 	"Add some nice spacing to the suggestion."
  	offering := offering copyReplaceAll: ':' with: ':  '.
  	offering last = Character space ifTrue: [offering := offering allButLast].
  	
+ 	"Insert the suggestions. (Note that due to previous selection, things will be overwritten and not appended.)"
- 	self openTypeInFor: #query.
  	self typeAhead nextPutAll: offering.
  
  	^ false!



More information about the Squeak-dev mailing list