diff options
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/config.rs b/src/config.rs index 12b82945..1c28d060 100644 --- a/src/config.rs +++ b/src/config.rs @@ -113,7 +113,7 @@ pub struct Config { pub minus_file: Option<PathBuf>, pub minus_non_emph_style: Style, pub minus_style: Style, - pub navigate_regexp: Option<String>, + pub navigate_regex: Option<String>, pub navigate: bool, pub null_style: Style, pub null_syntect_style: SyntectStyle, @@ -208,8 +208,10 @@ impl From<cli::Opt> for Config { side_by_side_data, ); - let navigate_regexp = if opt.navigate || opt.show_themes { - Some(navigate::make_navigate_regexp( + let navigate_regex = if (opt.navigate || opt.show_themes) + && (opt.navigate_regex.is_none() || opt.navigate_regex == Some("".to_string())) + { + Some(navigate::make_navigate_regex( opt.show_themes, &file_modified_label, &file_added_label, @@ -218,7 +220,7 @@ impl From<cli::Opt> for Config { &hunk_label, )) } else { - None + opt.navigate_regex }; let wrap_max_lines_plus1 = adapt_wrap_max_lines_argument(opt.wrap_max_lines); @@ -320,7 +322,7 @@ impl From<cli::Opt> for Config { minus_non_emph_style: styles["minus-non-emph-style"], minus_style: styles["minus-style"], navigate: opt.navigate, - navigate_regexp, + navigate_regex, null_style: Style::new(), null_syntect_style: SyntectStyle::default(), pager: opt.pager, |