aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjake <jake@jakes-mail.top>2022-02-04 14:30:49 -0500
committerjake <jake@jakes-mail.top>2022-02-04 14:30:49 -0500
commit00bb8d7a7ac887d3599a2cc33e6cf363d471da96 (patch)
treeeae0e2e24e96a81104ea0dcd925cab0a83c5fcce
parent066878d4d7080479a989d3bb6be2a9799e0f4c32 (diff)
back() will recall links from cache
-rwxr-xr-xgmi.pl14
1 files changed, 10 insertions, 4 deletions
diff --git a/gmi.pl b/gmi.pl
index 8482c86..deb5def 100755
--- a/gmi.pl
+++ b/gmi.pl
@@ -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);
}