diff options
| author | Fuwn <[email protected]> | 2022-07-17 10:56:37 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-07-17 10:56:37 +0000 |
| commit | e20cedb11300eb45ef051e80d064ea937df73722 (patch) | |
| tree | cfadd08234439ef4acab0604737cac4cf973ea0c /src/command.rs | |
| parent | feat(app.rs): auto obtain terminal width (diff) | |
| download | sydney-e20cedb11300eb45ef051e80d064ea937df73722.tar.xz sydney-e20cedb11300eb45ef051e80d064ea937df73722.zip | |
feat(input.rs): refresh and validate wrap width
Diffstat (limited to 'src/command.rs')
| -rw-r--r-- | src/command.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/command.rs b/src/command.rs index f17b235..66f3139 100644 --- a/src/command.rs +++ b/src/command.rs @@ -38,7 +38,15 @@ impl From<String> for Command { }, |at| { match at.parse() { - Ok(at_parsed) => Self::Wrap(at_parsed, None), + Ok(at_parsed) => + Self::Wrap( + if at_parsed == 0 { + crossterm::terminal::size().unwrap_or((80, 24)).0 + } else { + at_parsed + }, + None, + ), Err(error) => Self::Wrap(80, Some(error.to_string())), } }, |