diff options
author | Thomas Otto <th1000s@posteo.net> | 2020-12-30 21:03:22 +0100 |
---|---|---|
committer | Thomas Otto <th1000s@posteo.net> | 2021-10-16 14:07:30 +0200 |
commit | dda6fdb457f347027398b79f5fe4a88cdc02ec0c (patch) | |
tree | 196547159946482ddfd44dae39623ca7bd1f6187 /src/style.rs | |
parent | ebd008c364bc43cd71ee31a3570a03f6dd80a493 (diff) |
Add side-by-side line wrapping
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 enough, it is right-aligned.
Wrapping is limited to a certain number of lines
(--wrap-max-lines), if this is exceeded the line is
truncated by a now highlighted truncation symbol.
To disable wrapping set this value to 0.
Diffstat (limited to 'src/style.rs')
-rw-r--r-- | src/style.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/style.rs b/src/style.rs index 8fb9b2eb..4f590f0f 100644 --- a/src/style.rs +++ b/src/style.rs @@ -6,7 +6,7 @@ use lazy_static::lazy_static; use crate::ansi; use crate::color; -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Default)] pub struct Style { pub ansi_term_style: ansi_term::Style, pub is_emph: bool, @@ -28,6 +28,12 @@ pub enum DecorationStyle { NoDecoration, } +impl Default for DecorationStyle { + fn default() -> Self { + Self::NoDecoration + } +} + impl Style { pub fn new() -> Self { Self { |