Skip to content

Commit

Permalink
Only use one page name prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
baskerville committed Nov 25, 2020
1 parent c9afab7 commit 288c154
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/NAVIGATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

To name a page, hold the current page indicator and select the *Name* entry. A page name can be an uppercase ASCII letter, a lowercase roman numeral or an arabic numeral.

Once a page is named, you can jump to any page above it in the same category. For example if you've defined page 15 as *vi*, by entering *'ix* (or *"ix*), in the *Go to page* input field, you'll jump to page 18.
Once a page is named, you can jump to any page above it in the same category. For example if you've defined page 15 as *vi*, by entering *'ix*, in the *Go to page* input field, you'll jump to page 18.

You can also select a page name in the book's text and jump to it by tapping *Go To* in the selection menu. This can be particularly useful within a book's index.

Expand Down
4 changes: 2 additions & 2 deletions src/view/reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2994,10 +2994,10 @@ impl View for Reader {
true
},
Event::Submit(ViewId::GoToPageInput, ref text) => {
let re = Regex::new(r#"^([-+"'])?(.+)$"#).unwrap();
let re = Regex::new(r#"^([-+'])?(.+)$"#).unwrap();
if let Some(caps) = re.captures(text) {
let prefix = caps.get(1).map(|m| m.as_str());
if prefix == Some("\"") || prefix == Some("'") {
if prefix == Some("'") {
if let Some(location) = self.find_page_by_name(&caps[2]) {
self.go_to_page(location, true, hub, rq, context);
}
Expand Down

0 comments on commit 288c154

Please sign in to comment.