diff --git a/src/cli.rs b/src/cli.rs index 9acda0d72..fba95320c 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -468,12 +468,12 @@ pub struct Opt { /// Symbol indicating that a line has been wrapped and that the subsequent /// content is displayed right-aligned. - #[structopt(long = "side-by-side-wrap-right-symbol", default_value = "↴")] - pub side_by_side_wrap_right_symbol: String, + #[structopt(long = "side-by-side-wrap-right-wrap-symbol", default_value = "↴")] + pub side_by_side_wrap_right_wrap_symbol: String, /// Symbol displayed in front of right-aligned wrapped content. - #[structopt(long = "side-by-side-wrap-right-align-symbol", default_value = "…")] - pub side_by_side_wrap_right_align_symbol: String, + #[structopt(long = "side-by-side-wrap-right-prefix-symbol", default_value = "…")] + pub side_by_side_wrap_right_prefix_symbol: String, #[structopt(long = "file-modified-label", default_value = "")] /// Text to display in front of a modified file path. diff --git a/src/config.rs b/src/config.rs index 88538f29a..f96307590 100644 --- a/src/config.rs +++ b/src/config.rs @@ -261,8 +261,8 @@ impl From for Config { truncation_symbol: format!("{}→{}", ansi::ANSI_SGR_REVERSE, ansi::ANSI_SGR_RESET), wrap_config: side_by_side_wrap::WrapConfig { wrap_symbol: opt.side_by_side_wrap_symbol, - wrap_right_symbol: opt.side_by_side_wrap_right_symbol, - right_align_symbol: opt.side_by_side_wrap_right_align_symbol, + wrap_right_wrap_symbol: opt.side_by_side_wrap_right_wrap_symbol, + wrap_right_prefix_symbol: opt.side_by_side_wrap_right_prefix_symbol, // TODO, support multi-character symbols, and thus store // right_align_symbol_len here? use_wrap_right_permille: { diff --git a/src/features/side_by_side_wrap.rs b/src/features/side_by_side_wrap.rs index 7839207f7..eb293da11 100644 --- a/src/features/side_by_side_wrap.rs +++ b/src/features/side_by_side_wrap.rs @@ -14,8 +14,8 @@ use super::{line_numbers::SideBySideLineWidth, side_by_side::available_line_widt #[derive(Clone)] pub struct WrapConfig { pub wrap_symbol: String, - pub wrap_right_symbol: String, - pub right_align_symbol: String, + pub wrap_right_wrap_symbol: String, + pub wrap_right_prefix_symbol: String, // In fractions of 1000 so that a >100 wide panel can // still be configured down to a single character. pub use_wrap_right_permille: usize, @@ -165,7 +165,7 @@ where match result.last_mut() { Some(ref mut vec) if !vec.is_empty() => { - vec.last_mut().unwrap().1 = &wrap_config.wrap_right_symbol + vec.last_mut().unwrap().1 = &wrap_config.wrap_right_wrap_symbol } _ => unreachable!("wrap result must not be empty"), } @@ -181,7 +181,7 @@ where n => right_aligned_line.push((*fill_style, &SPACES[0..n])), } - right_aligned_line.push((symbol_style, &wrap_config.right_align_symbol)); + right_aligned_line.push((symbol_style, &wrap_config.wrap_right_prefix_symbol)); // skip LINEPREFIX right_aligned_line.extend(curr_line.into_iter().skip(1)); @@ -520,8 +520,8 @@ mod tests { lazy_static! { static ref TEST_WRAP_CFG: WrapConfig = WrapConfig { wrap_symbol: W.into(), - wrap_right_symbol: WR.into(), - right_align_symbol: RA.into(), + wrap_right_wrap_symbol: WR.into(), + wrap_right_prefix_symbol: RA.into(), use_wrap_right_permille: 370, max_lines: 5, }; diff --git a/src/options/set.rs b/src/options/set.rs index e94af02cc..25febc0eb 100644 --- a/src/options/set.rs +++ b/src/options/set.rs @@ -172,9 +172,9 @@ pub fn set_options( show_themes, side_by_side, side_by_side_wrap_max_lines, - side_by_side_wrap_right_align_symbol, + side_by_side_wrap_right_prefix_symbol, side_by_side_wrap_right_percent, - side_by_side_wrap_right_symbol, + side_by_side_wrap_right_wrap_symbol, side_by_side_wrap_symbol, tab_width, tokenization_regex,