# $window-x-scroll(5)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

$window-x-sroll - Current window X scroll
$window-xcl-sroll - Current window current line X scroll
$window-y-sroll - Current window Y scroll

## SYNOPSIS

$window-x-sroll integer
$window-xcl-sroll integer

0 <= integer <= 65535

$window-y-sroll integer

0 <= integer <= n

## DESCRIPTION

$window-x-sroll defines the horizontal scroll position in the current window for all lines except the current line, $window-xcl-sroll defines the scroll position for the current line. The variables set how many characters are scrolled off the left hand edge of the current window, the variables are indirectly set by commands such as scroll-left(2), forward-char(2) etc.

$window-y-sroll defines the vertical scroll position in the current window. It sets the number of lines are scroll up off the top of the current window, it is indirectly set by commands such as scroll-up(2), forward-line(2) etc.

## EXAMPLE

The following example first stores the current window's buffer position and the window layout. The middle '`...`' section could be replaced with macro code performing any number of operations before the last section which restores the initial position:

        set-variable #l0 $window-line
        set-variable #l1 $window-col
        set-variable #l2 $window-xcl-scroll
        set-variable #l3 $window-x-scroll
        set-variable #l4 $window-y-scroll
            .
            .
            .
        set-variable $window-line #l0
        set-variable $window-col #l1
        set-variable $window-xcl-scroll #l2
        set-variable $window-x-scroll #l3
        set-variable $window-y-scroll #l4

## NOTES

If these variables are set by the user or a macro the value is validated against the $scroll(5) method and the current cursor position which may lead to the variable being reset if found to be invalid. For example, if the current line is 10 when the $window-y-scroll is set to 20 the variable will be reset to 0 as a value of 20 will mean the current line is not displayed in the current window.

## SEE ALSO

scroll-left(2), scroll-up(2), $scroll(5), $window-line(5), $window-col(5), $window-acol(5).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>