--- a/ListView.st Tue Jul 18 15:31:23 2017 +0200
+++ b/ListView.st Tue Jul 18 15:31:36 2017 +0200
@@ -839,12 +839,17 @@
!
at:lineNr
- "retrieve a line; return nil if beyond end-of-text.
- this allows textViews to be used like collections in some places."
+ "retrieve a line's item;
+ return nil if beyond end-of-text.
+ this allows textViews to be used like collections in some places.
+ Notice: for text lists, this returns strings (same as listAt:);
+ for non-text lists, the item is returned."
list isNil ifTrue:[^ nil].
(lineNr between:1 and:self size) ifFalse:[^ nil].
^ list at:lineNr
+
+ "Modified (comment): / 18-07-2017 / 13:35:26 / cg"
!
at:index put:aString
@@ -1211,17 +1216,17 @@
listAt:lineNr
"given a lineNumber, return the corresponding string
This is used for accessing; i.e. for non-string entries, this
- returns the corresponding string."
+ returns the corresponding string.
+ Use #at: to get to the real item (if it is not a string)"
|l|
- list isNil ifTrue:[^ nil].
- (lineNr between:1 and:self size) ifFalse:[^ nil].
l := self at:lineNr.
l isNil ifTrue:[^ l].
^ self visibleStringFrom:l "/ l asString
- "Modified: 7.9.1995 / 15:54:59 / claus"
+ "Modified: / 07-09-1995 / 15:54:59 / claus"
+ "Modified: / 18-07-2017 / 13:35:54 / cg"
!
removeFromIndex:startLineNr toIndex:endLineNr