hiGoToLine
hiGoToLine(
w_windowId
x_lineNo
?highlight g_highlight
?align g_align
?forceAlign g_forceAlign
)
=> t / nil
Description
Positions the specified line number onscreen for a given text window
Arguments
|
w_windowId
|
Specifies the ID of the text editor window
|
|
x_lineNo
|
Specifies the desired line number that you want to highlight. The line numbers start at 1.
|
|
?highlight g_highlight
|
|
|
Highlights the line with a green background to help you locate the desired line number.
Like any selection, the highlight will disappear when the left mouse is clicked in the text window.
The default value is t.
|
|
?align g_align
|
Indicates where the highlighted line should be positioned with respect to the window of the text editor, that is at the top, in the middle, or at the bottom of the window.
If the line is already in the visible area of the window, the viewport does not adjusted unless ?forceAlign is set to t.
Valid values are 'top, 'center or 'bottom.
|
|
?forceAlign g_forceAlign
|
|
|
Adjusts the visible region to respect the value for ?align, even if the requested line was already visible.
The ?forceAlign parameter is most likely to be useful while working on code, especially, where you want to alter what is displayed in the viewport. For example, positioning the required line at the top of a verilog block, rather than just ensuring that the line is somewhere on the page.
|
Values Returned
|
t
|
The line number is valid and can be shown.
|
|
nil
|
The line number cannot be shown.
|
Examples
win=view( "myFile.txt");; Opens a text file
hiGoToLine(win 100 ?highlight t ?align 'center ?forceAlign t) ;; Highlights line 100 in the center of the window
hiGoToLine(win 110 ?highlight t ?align 'center ?forceAlign nil);; Highlights line 110, but if it's already visible, don't force it to be centered
Related Topics
Functions of Viewfile Window
Return to top