diff options
-rwxr-xr-x | gmi.pl | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -10,7 +10,7 @@ use bytes; use feature qw(refaliasing); no warnings qw(experimental::refaliasing); -our $VERSION = 'v0.0.21'; +our $VERSION = 'v0.0.22'; # TODO: # back() only works once; should fix this @@ -82,7 +82,7 @@ my %commands = ( 'display' => [sub { display() }, 'Display the current page.' ], 'd' => [sub { display() }, 'Alias of `display\'.' ], - 'usepager' => [sub { toggle('pager') }, 'This toggles pager use. 1 = use pager, 0 = stdout.' ], + 'usepager' => [sub { toggle($use_pager) }, 'This toggles pager use. 1 = use pager, 0 = stdout.' ], 'textwrap' => [sub { textwrap($_[0]) }, 'Set textwrap length.\nGiving \'auto\' will ' . "automatically determine the appropriate length. (Currently $wrapper->{columns})"], 'pager' => [sub { pager($_[0]) }, "Set which pager to use. (currently $ENV{pager})"], @@ -498,14 +498,6 @@ sub display { } sub toggle { - my ($t) = @_; - if ($t eq 'pager') { - set_toggle($use_pager); - print "$use_pager\n"; - } -} - -sub set_toggle { # refaliasing \my $t = \$_[0]; if ($t == 1) { @@ -514,6 +506,7 @@ sub set_toggle { else { $t = 1; } + print "$t\n"; } sub textwrap { |