| 1 | package Vim::X::Window; | ||||||||||
| 2 | BEGIN { | ||||||||||
| 3 | 3 | ▶ | $Vim::X::Window::AUTHORITY = 'cpan:YANICK'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | } | ||||||||||
| 5 | # ABSTRACT: A window in Vim | ||||||||||
| 6 | 3 | $Vim::X::Window::VERSION = '1.0.1'; | |||||||||
| 7 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 3 | ▶ | use Vim::X; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 3 | ▶ | use Vim::X::Buffer; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 3 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 3 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | |||||||||||
| 16 | 3 | has _window => ( | |||||||||
| 17 | is => 'ro', | ||||||||||
| 18 | required => 1, | ||||||||||
| 19 | ); | ||||||||||
| 20 | |||||||||||
| 21 | |||||||||||
| 22 | sub buffer { | ||||||||||
| 23 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
buffer: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 24 | 0 | return Vim::X::Buffer->new( _buffer => $self->_window->Buffer, index => | |||||||||
| 25 | 0 ); | ||||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | |||||||||||
| 29 | sub cursor { | ||||||||||
| 30 | 0 | ▶ | my $win = shift; | ||||||||
|
Subroutine
cursor: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 31 | 0 | my @cursor = $win->_window->Cursor; | |||||||||
| 32 | return wantarray ? @cursor | ||||||||||
| 33 | 0 | ▶ | : Vim::X::Line->new( buffer => $win->buffer, index => $cursor[0] ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 3 | 1; | |||||||||
| 37 | |||||||||||
| 38 | __END__ | ||||||||||
| 39 | |||||||||||
| 40 | =pod | ||||||||||
| 41 | |||||||||||
| 42 | =encoding UTF-8 | ||||||||||
| 43 | |||||||||||
| 44 | =head1 NAME | ||||||||||
| 45 | |||||||||||
| 46 | Vim::X::Window - A window in Vim | ||||||||||
| 47 | |||||||||||
| 48 | =head1 VERSION | ||||||||||
| 49 | |||||||||||
| 50 | version 1.0.1 | ||||||||||
| 51 | |||||||||||
| 52 | =head1 FUNCTIONS | ||||||||||
| 53 | |||||||||||
| 54 | =head2 buffer() | ||||||||||
| 55 | |||||||||||
| 56 | Returns the buffer associated with the window as a .L<Vim::X::Buffer> object | ||||||||||
| 57 | |||||||||||
| 58 | =head2 cursor() | ||||||||||
| 59 | |||||||||||
| 60 | Returns the cursor position in the window. | ||||||||||
| 61 | In list context, returns the I<(line,colum)> coordinates. In scalar | ||||||||||
| 62 | context, the line as a L<Vim::X::Line> object. | ||||||||||
| 63 | |||||||||||
| 64 | =head1 AUTHOR | ||||||||||
| 65 | |||||||||||
| 66 | Yanick Champoux <yanick@cpan.org> | ||||||||||
| 67 | |||||||||||
| 68 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 69 | |||||||||||
| 70 | This software is copyright (c) 2014 by Yanick Champoux. | ||||||||||
| 71 | |||||||||||
| 72 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 73 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 74 | |||||||||||
| 75 | =cut | ||||||||||