From e159b43ae28e13e555279e4532ae43ce7b91b9c8 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Wed, 29 Jul 2020 15:28:48 -0400 Subject: [PATCH] Refactor: sort struct entries --- src/config.rs | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/config.rs b/src/config.rs index 58be4941d..13a0c9c53 100644 --- a/src/config.rs +++ b/src/config.rs @@ -28,10 +28,18 @@ pub struct Config { pub file_renamed_label: String, pub file_style: Style, pub git_config_entries: HashMap, - pub keep_plus_minus_markers: bool, pub hunk_header_style: Style, pub hyperlinks: bool, pub hyperlinks_file_link_format: String, + pub keep_plus_minus_markers: bool, + pub line_numbers: bool, + pub line_numbers_left_format: String, + pub line_numbers_left_style: Style, + pub line_numbers_minus_style: Style, + pub line_numbers_plus_style: Style, + pub line_numbers_right_format: String, + pub line_numbers_right_style: Style, + pub line_numbers_zero_style: Style, pub max_buffered_lines: usize, pub max_line_distance: f64, pub max_line_distance_for_naively_paired_lines: f64, @@ -43,29 +51,21 @@ pub struct Config { pub navigate: bool, pub null_style: Style, pub null_syntect_style: SyntectStyle, - pub line_numbers_left_format: String, - pub line_numbers_left_style: Style, - pub line_numbers_minus_style: Style, - pub line_numbers_plus_style: Style, - pub line_numbers_right_format: String, - pub line_numbers_right_style: Style, - pub line_numbers_zero_style: Style, pub paging_mode: PagingMode, pub plus_emph_style: Style, pub plus_empty_line_marker_style: Style, pub plus_file: Option, pub plus_non_emph_style: Style, pub plus_style: Style, - pub line_numbers: bool, pub side_by_side: bool, pub side_by_side_data: side_by_side::SideBySideData, pub syntax_dummy_theme: SyntaxTheme, pub syntax_set: SyntaxSet, pub syntax_theme: Option, pub tab_width: usize, + pub tokenization_regex: Regex, pub true_color: bool, pub truncation_symbol: String, - pub tokenization_regex: Regex, pub whitespace_error_style: Style, pub zero_style: Style, } @@ -140,10 +140,18 @@ impl From for Config { file_renamed_label: opt.file_renamed_label, file_style, git_config_entries: opt.git_config_entries, - keep_plus_minus_markers: opt.keep_plus_minus_markers, hunk_header_style, hyperlinks: opt.hyperlinks, hyperlinks_file_link_format: opt.hyperlinks_file_link_format, + keep_plus_minus_markers: opt.keep_plus_minus_markers, + line_numbers: opt.line_numbers, + line_numbers_left_format: opt.line_numbers_left_format, + line_numbers_left_style, + line_numbers_minus_style, + line_numbers_plus_style, + line_numbers_right_format: opt.line_numbers_right_format, + line_numbers_right_style, + line_numbers_zero_style, max_buffered_lines: 32, max_line_distance: opt.max_line_distance, max_line_distance_for_naively_paired_lines, @@ -155,20 +163,12 @@ impl From for Config { navigate: opt.navigate, null_style: Style::new(), null_syntect_style: SyntectStyle::default(), - line_numbers_left_format: opt.line_numbers_left_format, - line_numbers_left_style, - line_numbers_minus_style, - line_numbers_plus_style, - line_numbers_right_format: opt.line_numbers_right_format, - line_numbers_right_style, - line_numbers_zero_style, paging_mode: opt.computed.paging_mode, plus_emph_style, plus_empty_line_marker_style, plus_file: opt.plus_file.map(|s| s.clone()), plus_non_emph_style, plus_style, - line_numbers: opt.line_numbers, side_by_side: opt.side_by_side, side_by_side_data, syntax_dummy_theme: SyntaxTheme::default(),