From dda6fdb457f347027398b79f5fe4a88cdc02ec0c Mon Sep 17 00:00:00 2001 From: Thomas Otto Date: Wed, 30 Dec 2020 21:03:22 +0100 Subject: 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. --- src/style.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/style.rs') 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 { -- cgit v1.2.3