focus Parameter

Specifies the focus lines of the file view.

Scope: View

Syntax

query focus.{bottom|next|top|row} 
set focus.{bottom|next|top|row [RowNumber]} 

Options

bottom 
Set the line in the display area that triggers upward scrolling of the file. It is the lowest line on which you can place the cursor. The default value is -3.
next 
Focus line for next file view. Temporarily overrides the standard focus.row and margin triggering. Margin triggering refers to the automatic scrolling that occurs when the cursor is positioned above focus.top or below focus.bottom. For the next display only, the current position is displayed on the focus.next row. The default value for focus.next is 0.

The focus.next parameter describes an absolute line on the physical screen, rather than a line within the editing window. You can use it to position files within windows. The focus command can be used to set focus.next equivalent to focus.row, thus moving the current position to the focus line of the file view.

top 
Set the line in the display area that triggers downward scrolling of the file. It is the highest line on which you can place the cursor. The default value is 3.
row 
Sets the line in the display area that is used by the focus command as the default.

If RowNumber is not specified, or if it is zero, the focus row defaults to the line in the center of the window. A positive number counts from the top of the file view downward, a negative number counts from the bottom of the file view upward.

Description

The focus parameter sets a line in the file view as the focus line. (The focus line is the line to which the current position moves when you issue the focus command.) You specify the focus line using set focus.row. If a number is not specified, the RowNumber defaults to the middle row of the file view.

The focus area is the area of the view where you can place the cursor to scroll the file. It is specified using set focus.bottom and set focus.top to specify the bottom and top focus lines respectively. When you place the cursor on either the top focus line or the bottom focus line, the contents of the window are scrolled up or down. (The cursor remains on the focus line.)

To override the focus line for one display only, use the set focus.next command. This specifies the actual line in the view on which to position the current position the next time the file is displayed in this file view.

Examples

  1. To set the fifth row from the bottom as the row that triggers downward scrolling, type:
    set focus.bottom -5
  2. To position a file in a window so that the eighth line above the current position is the first line in the display, type:
    set focus.next 8 

    The focus line is set to eight only until the cursor is moved again

  3. To set the fifth row from the top as the row that triggers upward scrolling, type:
    set focus.top 5 
  4. To define line 2 as the focus line to be used by the focus command as a default, type:
    set focus.row 2 
  5. To remove lines that cause scrolling, type:
    set focus.bottom
    set focus.top

    By not specifying the RowNumber, you can set the focus line to either the very bottom, or the very top of the window.

API Return Code

-2 
The RowNumber specified was larger than the number of rows in the file view. To find out the number of rows in the window, use the query dispdepth command.

focus Command