# HG changeset patch # User Claus Gittinger # Date 939910089 -7200 # Node ID 46edc54e3e0ed33a2de22daefbc116ba81c37d58 # Parent 6b611af5eb4f18a0a5ab149b644016c44b2b8d06 show syntaxHighlighted code in cursorLine first; usually, thats where you look at. diff -r 6b611af5eb4f -r 46edc54e3e0e BrowserView.st --- 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!