Skip to content

Commit

Permalink
Bump termion to 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gyscos committed Feb 6, 2024
1 parent b9663e3 commit 2f481e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cursive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ version = "0.17"

[dependencies.termion]
optional = true
version = "2"
version = "3"

[dependencies.crossterm]
optional = true
Expand Down
7 changes: 3 additions & 4 deletions cursive/src/backends/termion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ use crate::Vec2;

use std::cell::{Cell, RefCell};
use std::fs::File;
use std::io::{BufWriter, Write};
use std::io::Write;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;

/// Backend using termion
pub struct Backend {
// Do we want to make this generic on the writer?
terminal: RefCell<AlternateScreen<MouseTerminal<RawTerminal<BufWriter<File>>>>>,
terminal: RefCell<AlternateScreen<MouseTerminal<RawTerminal<File>>>>,
current_style: Cell<theme::ColorPair>,

// Inner state required to parse input
Expand Down Expand Up @@ -129,8 +129,7 @@ impl Backend {
// Use a ~8MB buffer
// Should be enough for a single screen most of the time.
let terminal = RefCell::new(
MouseTerminal::from(BufWriter::with_capacity(8_000_000, output_file).into_raw_mode()?)
.into_alternate_screen()?,
MouseTerminal::from(output_file.into_raw_mode()?).into_alternate_screen()?,
);

write!(terminal.borrow_mut(), "{}", termion::cursor::Hide)?;
Expand Down

0 comments on commit 2f481e3

Please sign in to comment.