Source

Kephra / lib / Kephra / Document.pm

use strict;
use warnings;

package Kephra::Document;
use Moo;
use File::Spec;

has editor => (
    is  => 'rw',
    isa => sub {die "$_[0] is no editor" unless ref $_[0] eq 'Kephra::App::Editor'},
    #default => sub { },
);
has file_path    => ( is  => 'rw', required => 1 );
has label        => ( is  => 'rw', default => sub {
    return '' unless $_[0]->file_path;
    my $file_name = ( File::Spec->splitpath( $_[0]->file_path ) )[2];
    # cut off ending ??
    # $file_name  = substr $file_name, 0, index ($file_name,'.') if index ($file_name,'.');
} );
#has content      => ( is  => 'rw' );
has notes        => ( is  => 'rw', );

has syntax_mode  => ( is  => 'rw', default => sub { 'perl' } );
has readonly     => ( is  => 'rw', );
has active_config=> ( is  => 'rw', );
has caret_pos    => ( is  => 'rw', );
has edit_pos     => ( is  => 'rw', );
has coding       => ( is  => 'rw', );
has EOL          => ( is  => 'rw', );
has tab_size     => ( is  => 'rw', );
has tab_use      => ( is  => 'rw', );
has folded_lines => ( is  => 'rw', );
has marked_lines => ( is  => 'rw', );

sub insert_before_caret {}
sub insert_after_caret {}
sub find {}

1;