# HG changeset patch # User Jan Vrany # Date 1460535853 -3600 # Node ID d6040b3f1a371861562f86c4d0afb26933dd927f # Parent 3f63a8393f8ea7105e9bfc0bde48057318b9816e# Parent bfc80e89fb1a342c4ca477f7efc05815715a5d24 Merge diff -r 3f63a8393f8e -r d6040b3f1a37 SelectionInListView.st --- a/SelectionInListView.st Sat Apr 09 08:57:26 2016 +0100 +++ b/SelectionInListView.st Wed Apr 13 09:24:13 2016 +0100 @@ -3600,7 +3600,11 @@ ]. newSelection := selectionAtClickTime copy. - newSelection isNil ifTrue:[newSelection := OrderedCollection new]. + newSelection isNil ifTrue:[ + newSelection := OrderedCollection new. + ] ifFalse:[ + newSelection := newSelection asOrderedCollection. + ]. "/ compute new selection delta := (clickLine < movedLine) ifTrue:[1] ifFalse:[-1]. diff -r 3f63a8393f8e -r d6040b3f1a37 TextView.st --- a/TextView.st Sat Apr 09 08:57:26 2016 +0100 +++ b/TextView.st Wed Apr 13 09:24:13 2016 +0100 @@ -885,33 +885,6 @@ !TextView methodsFor:'accessing'! -characterEncoding:encodingArg - "define how the contents is encoded internally. - This should normally never be required, as ST/X now assumes - unicode (of which iso8859-1 is a subset) encoding. - The possibility to change the characterEncoding is provided as - a backward compatibility hook for programs which want to use - another encoding internally." - - |encodingSymOrNil| - - encodingSymOrNil := encodingArg isNil - ifTrue:[#'iso10646-1'] - ifFalse:[encodingArg asSymbol]. - - gc characterEncoding ~~ encodingSymOrNil ifTrue:[ - "/ TODO: reencode contents if required. -"/ (list size ~~ 0 -"/ and:[ list contains:[:line | line size > 0]]) ifTrue:[ -"/ (self confirm:(resources stringWithCRs:'Your text may need to be re-coded - this is not yet supported.\\Proceed ?')) -"/ ifFalse:[^ self]. -"/ ]. - super characterEncoding:encodingSymOrNil. - ]. - - "Modified (format): / 25-01-2012 / 00:28:27 / cg" -! - characterPositionOfSelection "return the character index of the first character in the selection. Returns 0 if there is no selection." @@ -2759,6 +2732,8 @@ self removeTrailingWhitespace. + "/ This is now obsolete, as we are always using unicode internally. + "/ so the following line should be changed to encoderToEncodeFrom:unicode to:xxx. encoder := CharacterEncoder encoderToEncodeFrom:gc characterEncoding into:encodingSymOrNil. encoder isNullEncoder ifTrue:[ (list contains:[:lineOrNil| @@ -5000,8 +4975,10 @@ selectionStartLine isNil ifTrue:[^ nil]. sel := self textFromLine:selectionStartLine col:(selectionStartCol max:1) toLine:selectionEndLine col:selectionEndCol. sel notEmptyOrNil ifTrue:[ - (gc characterEncoding ? #'iso10646-1' "eg unicode") ~~ #'iso10646-1' ifTrue:[ - sel := sel encodeFrom:gc characterEncoding into:#'iso10646-1' + "/ this is rubbish; we are now always using unicode internally + "/ any many more conversions would be needed at many places... + (gc characterEncoding ? #'iso10646-1' "eg unicode") ~~ #'iso10646-1' ifTrue:[ + sel := sel encodeFrom:gc characterEncoding into:#'iso10646-1' ]. ]. ^ sel @@ -5020,9 +4997,12 @@ ! selectionChanged - "can be redefined for notification or special actions" - - "Modified: / 17-04-2012 / 20:59:49 / Jan Vrany " + "can be redefined for notification or special actions. + If you do, do not forget to do a super selectionChanged" + + self changed:#selection. +"/ self selectionHolder value:{ selectionStartCol @ selectionStartLine . +"/ selectionEndCol @ selectionEndLine } ! selectionEndCol