summaryrefslogtreecommitdiffstats
path: root/src/fail.rs
diff options
context:
space:
mode:
authorrabite <rabite@posteo.de>2019-03-19 01:08:22 +0100
committerrabite <rabite@posteo.de>2019-03-19 14:38:15 +0100
commit161ba5ac3f38733b45c0167cb1e29f0be6059775 (patch)
tree794ec2517c71f6e6e3b9c572ebcc0e2fca66c3f4 /src/fail.rs
parentc719ec7a3cb6ca3d2346f48dc11d2e0d5ee10d36 (diff)
handle terminal resizing
Diffstat (limited to 'src/fail.rs')
-rw-r--r--src/fail.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fail.rs b/src/fail.rs
index edbd0b2..97cbd62 100644
--- a/src/fail.rs
+++ b/src/fail.rs
@@ -66,7 +66,9 @@ pub enum HError {
#[fail(display = "Empty input!")]
MiniBufferEmptyInput,
#[fail(display = "Undefined key: {:?}", key)]
- WidgetUndefinedKeyError{key: Key}
+ WidgetUndefinedKeyError{key: Key},
+ #[fail(display = "Terminal has been resized!")]
+ TerminalResizedError,
}
impl HError {
@@ -109,6 +111,10 @@ impl HError {
Err(HError::PreviewFailed{ file: name,
backtrace: Backtrace::new() })
}
+
+ pub fn terminal_resized<T>() -> HResult<T> {
+ Err(HError::TerminalResizedError)
+ }
}