locate command

Use the locate command to move the cursor to the specified element, line, mark, sequence number, or sequence text in the document.

 

Syntax

locate [ emphasis ] { element n
                    | line n
                    | mark {name | #id}
                    | sequenceNumber n
                    | [ all ] sequenceText textSpec
                    } 

 

Parameters

emphasis Use the emphasis parameter to indicate that the target should be emphasized if it is found.
element n Use the element parameter to move the cursor to the specified element.  n must be a positive integer.  Elements include both show lines and non-show document lines.
line n Use the line parameter to move the cursor to the specified document line.  n must be a positive integer.  Document lines do not include show lines.
mark {name | #id} Use the mark parameter to move the cursor to the specified mark.  A mark may be indicated by its name or by its id.  id must be a positive integer.
sequenceNumber n Use the sequenceNumber parameter to move the cursor to the line with the specified sequence number.  n must be a positive integer.
all Use the optional all parameter to indicate that all the occurrences of the sought sequence-numbers text part should be located.
sequenceText
textSpec
Use the sequenceText parameter to move the cursor to the line with the specified sequence-numbers text part.  The text part to locate is specified by one or more parameters in textSpec as follows:

  string1 [ to string2 [ string3 [ to string4 ]]]

One or two string ranges may be specified;  in this case, the command will search for a line with a sequence-numbers textual part which is lexicographically between the given strings in either range.  An exact-match search is performed when only one string is specified.

Unless the all parameter was specified, the search is performed on the visible lines only.

 

Status

The status parameter will be set to one of the following:

null Indicates that the locate command successfully located the specified item.
locate.wrapped Indicates that the locate command successfully located the specified sequence-numbers text part, but had to wrap around to the beginning of the document during the search.
locate.notFound Indicates that the specified item could not be found.
locate.noSequenceText Indicates that no sequence-numbers text part was set in the document.

 

Examples

locate emphasis element 100
locate mark a
locate sequenceText 041201 to 041231 

Related concepts
Editor commands, actions, and parameters

Related reference
element parameter
elements parameter
emphasisLength parameter
line parameter
lines parameter
mark parameter
markId parameter
sequenceNumber parameter
sequenceNumbers parameter
sequenceText parameter
findMark action
findQuickMark action
locateLine action
Default editor commands