The Trunk: ST80-ul.223.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: ST80-ul.223.mcz

commits-2
Levente Uzonyi uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-ul.223.mcz

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

Name: ST80-ul.223
Author: ul
Time: 27 February 2017, 2:24:48.575741 am
UUID: 28571fe6-c3e1-40e0-9df6-9284829893ba
Ancestors: ST80-eem.222

- omit ifAbsent from #index* sends when the default value, 0 would used

=============== Diff against ST80-eem.222 ===============

Item was changed:
  ----- Method: ParagraphEditor>>cursorHome: (in category 'nonediting/nontyping keys') -----
  cursorHome: characterStream
 
  "Private - Move cursor from position in current line to beginning of
  current line. If control key is pressed put cursor at beginning of text"
 
  | string |
 
  string := paragraph text string.
  self
  moveCursor: [ :position | Preferences wordStyleCursorMovement
  ifTrue:[
  (paragraph lines at:(paragraph lineIndexOfCharacterIndex: position)) first]
  ifFalse:[
  (string
  lastIndexOfAnyOf: CharacterSet crlf
+ startingAt: position - 1) + 1]]
- startingAt: position - 1
- ifAbsent:[0]) + 1]]
  forward: false
  specialBlock: [:dummy | 1].
  ^true!

Item was changed:
  ----- Method: ParagraphEditor>>encompassLine: (in category 'new selection') -----
  encompassLine: anInterval
  "Return an interval that encompasses the entire line"
  | string left right |
  string := paragraph text string.
+ left := (string lastIndexOfAnyOf: CharacterSet crlf startingAt: anInterval first - 1) + 1.
- left := (string lastIndexOfAnyOf: CharacterSet crlf startingAt: anInterval first - 1 ifAbsent:[0]) + 1.
  right := (string indexOfAnyOf: CharacterSet crlf startingAt: anInterval last + 1 ifAbsent: [string size + 1]) - 1.
  ^left to: right!

Item was changed:
  ----- Method: ParagraphEditor>>saveContentsInFile (in category 'menu messages') -----
  saveContentsInFile
  "Save the receiver's contents string to a file, prompting the user for a file-name.  Suggest a reasonable file-name."
 
  | fileName stringToSave parentWindow labelToUse suggestedName |
  stringToSave := paragraph text string.
  stringToSave size = 0 ifTrue: [^ self inform: 'nothing to save.'].
  parentWindow := self model dependents
  detect: [:dep | dep isKindOf: SystemWindow orOf: StandardSystemView]
  ifNone: [nil].
  labelToUse := parentWindow
  ifNil: ['Untitled']
  ifNotNil: [parentWindow label].
  suggestedName := nil.
  #(('Decompressed contents of: ' '.gz')) do:  "can add more here..."
  [:leaderTrailer | | lastIndex |
  (labelToUse beginsWith: leaderTrailer first) ifTrue:
  [suggestedName := labelToUse copyFrom: leaderTrailer first size + 1 to: labelToUse size.
  (labelToUse endsWith: leaderTrailer last)
  ifTrue:
  [suggestedName := suggestedName copyFrom: 1 to: suggestedName size - leaderTrailer last size]
  ifFalse:
+ [lastIndex := suggestedName lastIndexOf: $..
+ (lastIndex > 1) ifTrue:
- [lastIndex := suggestedName lastIndexOf: $. ifAbsent: [0].
- (lastIndex = 0 or: [lastIndex = 1]) ifFalse:
  [suggestedName := suggestedName copyFrom: 1 to: lastIndex - 1]]]].
 
  suggestedName ifNil:
  [suggestedName := labelToUse, '.text'].
 
  fileName := UIManager default request: 'File name?' translated
  initialAnswer: suggestedName.
  fileName isEmptyOrNil ifFalse:
  [(FileStream newFileNamed: fileName) nextPutAll: stringToSave; close]!