8000 [feenkcom/gtoolkit#1397] scroll on text modification: don't get out o… · feenkcom/Brick@3c37d8a · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 3c37d8a

Browse files
committed
[feenkcom/gtoolkit#1397] scroll on text modification: don't get out of bounds
1 parent a6d6035 commit 3c37d8a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Brick-Editor/BrEditorElement.class.st

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ BrEditorElement >> privateScrollWhenTextModified: anEvent [
8484
ifEmpty: [ ^ self ].
8585

8686
aMaxIndex := (allCursors detectMax: [ :each | each position ]) position.
87+
aMaxIndex := aMaxIndex min: self text size.
8788
aTargetLine := (self text from: 1 to: aMaxIndex) lineCount.
8889

8990
self scrollToPosition: aTargetLine + 1

0 commit comments

Comments
 (0)
0