NAME

VERSION

METHODS

new( buffer => $buffer, index => $i )

Creates a new Vim::X::Buffer object. Both buffer and index arguments are required.

clone

Makes a copy of the object.

content( $new_content )

Sets the content of the line to ne $new_content or, if $new_content is not given, returns the current content.

append( @lines )

Append the @lines after the current line.

Carriage returns in lines will cause them to be splitted.

dec()

Makes the object point to the previous line. Returns the object or undef if at the beginning of the buffer and can't backtrack anymore.

inc()

Makes the object point to the next line. Returns the object or, undef if at the end of the buffer and can't advance anymore.

rewind( $condition )

Move back in the buffer until $condition is met.

The condition can be a regular expression, or a coderef that will return true on success. If the condition is not met, the method returns false and the line index of the object is not modified.

ff( $condition )

Move forward in the buffer until $condition is met.

The condition can be a regular expression, or a coderef that will return true on success. If the condition is not met, the method returns false and the line index of the object is not modified.

BIG HUGE WARNING

When created, the line objects store the buffer and index of the line they correspond to, so they are more like cursors than representations of the actual lines. If lines are added or deleted in the buffer, the object will not be updated in consequence. For example, this won't do what you think: