NAME

Zaphod::Editor::Cursor - encapsulates the cursor position

__PACKAGE__->new ARGS

Constructs a new insertion point object

$position->copy ARGS

Returns a shallow copy of the position and overwrites the values with ARGS where they are given

$p->as_string

Returns the position as a convenient string representation

$p->pos

Returns the column and the line as a list of two integers

move_left COUNT

Moves the cursor position COUNT elements to the left, wrapping lines if necessary.

Currently, it clamps the value to 0 instead.

(this should be configurable instead of hard-coded)

In void context, modifies the object in-place. In other context, a modified copy is returned and the original object remains as-is.

$c->move_right COUNT

Moves the cursor position COUNT elements to the right, wrapping lines if necessary.

Currently, it clamps the value to length $line instead.

(this should be configurable instead of hard-coded)

In void context, modifies the object in-place. In other context, a modified copy is returned and the original object remains as-is.

AUTHOR

Written by Max Maischein <corion@cpan.org>

Copyright Max Maischein 2005,2006; All Rights Reserved.

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

SEE ALSO

Zaphod