diff --git a/CHANGELOG.md b/CHANGELOG.md index 0680c6c..9daf88b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ This release adds a few new config options, for your convenience: or not. By default it's false, but one might find it handy to set to `true` if hosting, say, a Gopher-powered music server. +And a bonus: + +- `R` keyboard shortcut to refresh the current page. + ## v1.1.0 Three new features in this release, plus an unknown number of new diff --git a/doc/phetch.1 b/doc/phetch.1 index 9c1b9cf..930918e 100644 --- a/doc/phetch.1 +++ b/doc/phetch.1 @@ -199,9 +199,13 @@ Find link in page.\& .RS 4 Go to Gopher URL.\& .RE +\fBR\fR +.RS 4 +Reload current URL.\& +.RE \fBu\fR .RS 4 -Edit URL.\& (Can be used to reload the current page.\&) +Edit URL.\& .RE \fBy\fR .RS 4 diff --git a/doc/phetch.1.md b/doc/phetch.1.md index 5a239fd..1e06b9d 100644 --- a/doc/phetch.1.md +++ b/doc/phetch.1.md @@ -130,8 +130,10 @@ and *Ctrl-h* are synonyms. *g* Go to Gopher URL. +*R* + Reload current URL. *u* - Edit URL. (Can be used to reload the current page.) + Edit URL. *y* Copy URL. diff --git a/src/ui.rs b/src/ui.rs index e4deb0b..27bc681 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -663,6 +663,12 @@ impl UI { self.add_view(Box::new(text)); } } + 'R' => { + if let Some(view) = self.views.get(self.focused) { + let url = view.url().to_owned(); + self.open(&url, &url)?; + } + } 's' => { if let Some(view) = self.views.get(self.focused) { let url = view.url();