NAME

Text::Snippet::TabStop::Cursor - Provides a bi-directional iterator interface for moving from one tab-stop to it's siblings

CLASS METHODS

new

INSTANCE METHODS

  • snippet

    Maintains a reference to the snippet that this cursor is iterating over.

  • has_prev

    Returns true/false depending on whether the cursor can move to a previous tab stop.

  • prev

    Moves the cursor to the previous tab stop and returns that tab stop. You can only iterate one element off the end of the underlying set of tab stops.

  • has_next

    Returns true/false depending on whether the cursor can move to a subsequent tab stop.

  • next

    Moves the cursor to the next tab stop and returns that tab stop. You can only iterate one element off the end of the underlying set of tab stops.

  • current

    Returns the tab stop the cursor is currently pointing at. When the cursor is first created, this method will always return undef until next has been called at least once.

  • current_position

    Returns an ArrayRef reflecting the line/column position relative to the beginning of the snippet. Both numbers are zero-based so a tab stop starting on the first line, first character would return a value of [0,0].

  • current_char_position

    Returns an integer reflecting the current cursor position where 0 is the first character of the snippet and each character is counted up until the current position of the cursor.

  • is_terminal

    Returns true if this tab stop is a "terminal" tab stop (i.e. once the user iterates to this tab stop, the iterator should be restored and normal editing should resume).