pspad:
--------------------------------------------------------------------------------
VBR, better is use topLineIndex() funstion.
You know number of lines in the window - linesInWindow()
Half of it is center line - caretY position. So you need to set top line to
CaretY position - half of the lines in window
--------------------------------------------------------------------------------

Thanks for your suggestion; however, can you elaborate on the usage in the
script? - I can't find a way with less code than above and possibly without
repeated caret settings.
One could possibly check whether the current view (via topLineIndex) is below or
above the needed caret position and adjust the half-page offset to the needed
direction, but it seems a bit more complicated than the above. 

vbr

-- 
<http://forum.pspad.com/read.php?2,65966,65976>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem