diff --git a/ChangeLog b/ChangeLog index cb5ef2421..e4dbe78f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-03-29 18:25 Alexander Malmberg + + * Source/NSTextView.m (-setSelectedRange:affinity:stillSelecting:): + Always scroll to make the selection visible, and scroll to the right + part of it. (Bug reported by Ludovic Marcotte.) + 2004-03-27 Fred Kiefer * Header/AppKit/NSTableView.h: diff --git a/Source/NSTextView.m b/Source/NSTextView.m index 9e1d1516a..aadc21164 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -2827,13 +2827,17 @@ afterString in order over charRange. if (stillSelectingFlag == NO) { - // TODO - // Make the selected range visible - // We do not always want to scroll to the beginning of the - // selection - // however we do for sure if the selection's length is 0 - if (charRange.length == 0 && _tf.is_editable ) - [self scrollRangeToVisible: charRange]; + /* + TODO: should we really do this here? + + Make the insertion point (or the moving endpoint of the selection) + visible. + */ + if (affinity == NSSelectionAffinityUpstream) + [self scrollRangeToVisible: charRange]; + else + [self scrollRangeToVisible: + NSMakeRange(charRange.location + charRange.length, 0)]; } /* Try to optimize for overlapping ranges */