BrowserView.st
changeset 2428 46edc54e3e0e
parent 2425 0536e1b9504e
child 2429 fe077224ade0
--- a/BrowserView.st	Tue Oct 12 16:23:31 1999 +0200
+++ b/BrowserView.st	Thu Oct 14 16:08:09 1999 +0200
@@ -13011,7 +13011,8 @@
      with highlighted syntax.
      If there have been no modifications in the meantime, install it."
 
-    |firstShown lastShown sensor cursorWasOn anyChange|
+    |firstShown lastShown sensor cursorWasOn anyChange newLines l
+     replaceAction|
 
     codeView modified ifTrue:[
         "/ new input arrived in the meantime
@@ -13037,9 +13038,7 @@
     lastShown := codeView lastLineShown.
     sensor := self sensor.
 
-    anyChange := false.
-
-    newCode asStringCollection keysAndValuesDo:[:lNr :line |
+    replaceAction := [:lNr :line |
         |oldLine|
 
         oldLine := codeView listAt:lNr.
@@ -13076,6 +13075,20 @@
             ]
         ]
     ].
+
+    anyChange := false.
+
+    newLines := newCode asStringCollection.
+
+    "/ the cursor line first - thats where your eyes are ...
+    (l := codeView cursorLine) notNil ifTrue:[
+        l <= newLines size ifTrue:[
+            replaceAction value:l value:(newLines at:l)
+        ]
+    ].
+
+    newLines keysAndValuesDo:replaceAction.
+
     (anyChange and:[cursorWasOn]) ifTrue:[codeView showCursor].
 
     "Modified: / 5.2.1999 / 22:29:17 / cg"
@@ -13963,6 +13976,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.565 1999-10-10 12:44:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.566 1999-10-14 14:08:09 cg Exp $'
 ! !
 BrowserView initialize!