summaryrefslogtreecommitdiffstats
path: root/src/display/crop_writer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/display/crop_writer.rs')
-rw-r--r--src/display/crop_writer.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/display/crop_writer.rs b/src/display/crop_writer.rs
index 45758ba..1b6e508 100644
--- a/src/display/crop_writer.rs
+++ b/src/display/crop_writer.rs
@@ -1,8 +1,4 @@
use {
- crossterm::{
- terminal::{Clear, ClearType},
- QueueableCommand,
- },
termimad::{CompoundStyle, Result},
};
@@ -39,6 +35,13 @@ where
}
Ok(())
}
+ pub fn fill(&mut self, cs: &CompoundStyle, c: char) -> Result<()> {
+ while !self.is_full() {
+ self.allowed -= 1;
+ cs.queue(self.w, c)?;
+ }
+ Ok(())
+ }
pub fn queue_string(&mut self, cs: &CompoundStyle, s: String) -> Result<()> {
if !self.is_full() {
let len = s.chars().count();
@@ -57,8 +60,4 @@ where
pub fn queue_bg(&mut self, cs: &CompoundStyle) -> Result<()> {
cs.queue_bg(self.w)
}
- pub fn clear(&mut self, clear_type: ClearType) -> Result<()> {
- self.w.queue(Clear(clear_type))?;
- Ok(())
- }
}