diff options
author | jake <jake@jakes-mail.top> | 2022-02-04 14:30:49 -0500 |
---|---|---|
committer | jake <jake@jakes-mail.top> | 2022-02-04 14:30:49 -0500 |
commit | 00bb8d7a7ac887d3599a2cc33e6cf363d471da96 (patch) | |
tree | eae0e2e24e96a81104ea0dcd925cab0a83c5fcce /gmi.pl | |
parent | 066878d4d7080479a989d3bb6be2a9799e0f4c32 (diff) |
back() will recall links from cache
Diffstat (limited to 'gmi.pl')
-rwxr-xr-x | gmi.pl | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -38,7 +38,7 @@ use Term::ANSIColor; # Core use Path::Naive qw(normalize_path); # CPAN use Text::ParseWords; # Core use Term::ReadLine; # CPAN -#use Smart::Comments; # CPAN +use Smart::Comments; # CPAN use URI::Encode qw(uri_encode); # CPAN use IO::Socket::SSL::Utils; # CPAN use File::Slurper qw(read_dir read_text); # CPAN @@ -94,6 +94,7 @@ if (! -e $xdg_cache) { ### $xdg_data ### $xdg_cache my @cache; +my @cache_links; load_config(); my $wrapper = Text::Wrapper->new(columns=>$config{textwrap}, body_start=>''); @@ -306,6 +307,7 @@ sub url { if (@doc) { @cache = @doc; + @cache_links = @links; } undef(@doc); if (peer_cert($cl, $url->{host})) { @@ -825,10 +827,14 @@ sub back { if (@history >= 2) { $current_url="$history[-2][0]"; - if (@cache) { - my @array = @doc; + if ($cache[0]) { + my @dok = @doc; + my @linkz = @links; + @doc = @cache; - @cache = @array; + @links = @cache_links; + @cache = @dok; + @cache_links = @linkz; update_history( ["$current_url", "back"] ); display() if (! $display); } |