Skip to content

Commit

Permalink
make configure method can set tabstop
Browse files Browse the repository at this point in the history
  • Loading branch information
kaz-utashiro committed Mar 22, 2024
1 parent 597f510 commit cec95a2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion META.json
Expand Up @@ -4,7 +4,7 @@
"Kazumasa Utashiro"
],
"dynamic_config" : 0,
"generated_by" : "Minilla/v3.1.20, CPAN::Meta::Converter version 2.150010",
"generated_by" : "Minilla/v3.1.23, CPAN::Meta::Converter version 2.150010",
"license" : [
"perl_5"
],
Expand Down
9 changes: 7 additions & 2 deletions README.md
Expand Up @@ -59,7 +59,12 @@ unexportable functions without them.

- **configure**

Confiugre `Text::ANSI::Fold` object. Related parameters are those:
Confiugre and return the underlying `Text::ANSI::Fold` object.
Related parameters are those:

- **tabstop** => _num_

Set the value of variable `$Text::ANSI::Tabs::tabstop` to _num_.

- **tabhead** => _char_
- **tabspace** => _char_
Expand Down Expand Up @@ -100,7 +105,7 @@ Kazumasa Utashiro

# LICENSE

Copyright 2021-2023 Kazumasa Utashiro.
Copyright 2021-2024 Kazumasa Utashiro.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
17 changes: 14 additions & 3 deletions lib/Text/ANSI/Tabs.pm
Expand Up @@ -55,7 +55,13 @@ our $REMOVE_REDUNDANT = 1;

sub configure {
my $class = shift;
$fold->configure(@_);
@_ % 2 and die "invalid parameter.\n";
my %opt = @_;
if ($opt{tabstop}) {
$tabstop = $opt{tabstop};
}
$fold->configure(@_) if @_;
return $fold;
}

sub expand {
Expand Down Expand Up @@ -153,10 +159,15 @@ some redundant color designation code.
=item B<configure>
Confiugre C<Text::ANSI::Fold> object. Related parameters are those:
Confiugre and return the underlying C<Text::ANSI::Fold> object.
Related parameters are those:
=over 4
=item B<tabstop> => I<num>
Set the value of variable C<$Text::ANSI::Tabs::tabstop> to I<num>.
=item B<tabhead> => I<char>
=item B<tabspace> => I<char>
Expand Down Expand Up @@ -201,7 +212,7 @@ Kazumasa Utashiro
=head1 LICENSE
Copyright 2021-2023 Kazumasa Utashiro.
Copyright 2021-2024 Kazumasa Utashiro.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
Expand Down

0 comments on commit cec95a2

Please sign in to comment.