summaryrefslogtreecommitdiffstats
path: root/src/cli.rs
diff options
context:
space:
mode:
authorThomas Otto <th1000s@posteo.net>2020-12-30 21:03:22 +0100
committerThomas Otto <th1000s@posteo.net>2021-04-19 22:37:41 +0200
commitf71f4da9bae1c05432297d7b050edca26614d0ed (patch)
tree9a0539c996dc8001cf82361e183d59c9c388249f /src/cli.rs
parent1b20df46486e7d7ae4b5e7283961c1f6aebf2b70 (diff)
Add side-by-side line wrapping mode
If the current line does not fit into the panel, then it is not truncated but split into multiple lines. A wrapping symbol is placed at the end of the line. If the new line is short enought, it is right-aligned. Wrapping is limited to a certain number of lines, if this is exceeded the line is truncated by a now highlighted truncation symbol. Commandline argument `-S` / `--side-by-side-wrapped`. Also adapted `--keep-plus-minus-markers` logic, required to calculate the exact remaining panel width.
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 2ee73240..643168f9 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -217,6 +217,10 @@ pub struct Opt {
#[structopt(short = "s", long = "side-by-side")]
pub side_by_side: bool,
+ /// Display a side-by-side diff and wrap overlong lines instead of truncating them.
+ #[structopt(short = "S", long = "side-by-side-wrapped")]
+ pub side_by_side_wrapped: bool,
+
#[structopt(long = "diff-highlight")]
/// Emulate diff-highlight (https://github.com/git/git/tree/master/contrib/diff-highlight)
pub diff_highlight: bool,