The Trunk: System-eem.1037.mcz

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

The Trunk: System-eem.1037.mcz

commits-2
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1037.mcz

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

Name: System-eem.1037
Author: eem
Time: 5 July 2018, 9:20:54.634348 am
UUID: 7566d273-8d3d-413a-946c-e023e404bb26
Ancestors: System-kfr.1036

Remove bogus trailing cr in diff display in change list.

=============== Diff against System-kfr.1036 ===============

Item was changed:
  ----- Method: TextDiffBuilder>>buildDisplayPatch (in category 'creating patches') -----
  buildDisplayPatch
 
+ | stream result |
- | stream |
  stream := AttributedTextStream new.
 
  "Lazy initialize the text attributes cache."
  NormalTextAttributes ifNil: [NormalTextAttributes := self userInterfaceTheme normalTextAttributes
  ifNil: [{TextEmphasis normal}]].
  InsertTextAttributes ifNil: [InsertTextAttributes := self userInterfaceTheme insertTextAttributes
  ifNil: [{TextColor red}]].
  RemoveTextAttributes ifNil: [RemoveTextAttributes := self userInterfaceTheme removeTextAttributes
  ifNil: [{TextEmphasis struckOut. TextColor blue}]].
 
  self
  patchSequenceDoIfMatch: [ :string |
  self print: string withAttributes: NormalTextAttributes on: stream ]
  ifInsert: [ :string |
  self print: string withAttributes: InsertTextAttributes on: stream ]
  ifRemove: [ :string |
  self print: string withAttributes: RemoveTextAttributes on: stream ].
+ result := stream contents.
+ (result notEmpty
+ and: [result last = Character cr
+ and: [(self lastIsCR: xLines) not
+ and: [(self lastIsCR: yLines) not]]]) ifTrue:
+ [result := result allButLast].
+ ^result!
- ^stream contents!

Item was added:
+ ----- Method: TextDiffBuilder>>lastIsCR: (in category 'private') -----
+ lastIsCR: linesArray
+ | last |
+ ^linesArray notEmpty
+ and: [(last := linesArray last string) notEmpty
+ and: [last last = Character cr or: [last endsWith: String crlf]]]!