The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

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

VERSION

version 0.04

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).

AUTHOR

  Brian Phillips <bphillips@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Brian Phillips.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.