mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-24 01:46:31 +00:00
Use print! rather than println! for ncurses configuration
This commit is contained in:
parent
c626779d8a
commit
3f35b87757
@ -6,6 +6,7 @@ use backend;
|
|||||||
use event::{Event, Key, MouseButton, MouseEvent};
|
use event::{Event, Key, MouseButton, MouseEvent};
|
||||||
use std::cell::{Cell, RefCell};
|
use std::cell::{Cell, RefCell};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use std::io::{stdout, Write};
|
||||||
use theme::{Color, ColorPair, Effect};
|
use theme::{Color, ColorPair, Effect};
|
||||||
use utf8;
|
use utf8;
|
||||||
use vec::Vec2;
|
use vec::Vec2;
|
||||||
@ -183,7 +184,8 @@ impl backend::Backend for Concrete {
|
|||||||
// This asks the terminal to provide us with mouse drag events
|
// This asks the terminal to provide us with mouse drag events
|
||||||
// (Mouse move when a button is pressed).
|
// (Mouse move when a button is pressed).
|
||||||
// Replacing 1002 with 1003 would give us ANY mouse move.
|
// Replacing 1002 with 1003 would give us ANY mouse move.
|
||||||
println!("\x1B[?1002h");
|
print!("\x1B[?1002h");
|
||||||
|
stdout().flush().expect("could not flush stdout");
|
||||||
|
|
||||||
Concrete {
|
Concrete {
|
||||||
current_style: Cell::new(ColorPair::from_256colors(0, 0)),
|
current_style: Cell::new(ColorPair::from_256colors(0, 0)),
|
||||||
@ -208,7 +210,8 @@ impl backend::Backend for Concrete {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn finish(&mut self) {
|
fn finish(&mut self) {
|
||||||
println!("\x1B[?1002l");
|
print!("\x1B[?1002l");
|
||||||
|
stdout().flush().expect("could not flush stdout");
|
||||||
ncurses::endwin();
|
ncurses::endwin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ use backend;
|
|||||||
use event::{Event, Key, MouseButton, MouseEvent};
|
use event::{Event, Key, MouseButton, MouseEvent};
|
||||||
use std::cell::{Cell, RefCell};
|
use std::cell::{Cell, RefCell};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use std::io::{stdout, Write};
|
||||||
use theme::{Color, ColorPair, Effect};
|
use theme::{Color, ColorPair, Effect};
|
||||||
use utf8;
|
use utf8;
|
||||||
use vec::Vec2;
|
use vec::Vec2;
|
||||||
@ -148,6 +149,7 @@ impl backend::Backend for Concrete {
|
|||||||
// (Mouse move when a button is pressed).
|
// (Mouse move when a button is pressed).
|
||||||
// Replacing 1002 with 1003 would give us ANY mouse move.
|
// Replacing 1002 with 1003 would give us ANY mouse move.
|
||||||
print!("\x1B[?1002h");
|
print!("\x1B[?1002h");
|
||||||
|
stdout().flush().expect("could not flush stdout");
|
||||||
|
|
||||||
Concrete {
|
Concrete {
|
||||||
current_style: Cell::new(ColorPair::from_256colors(0, 0)),
|
current_style: Cell::new(ColorPair::from_256colors(0, 0)),
|
||||||
@ -168,6 +170,8 @@ impl backend::Backend for Concrete {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn finish(&mut self) {
|
fn finish(&mut self) {
|
||||||
|
print!("\x1B[?1002l");
|
||||||
|
stdout().flush().expect("could not flush stdout");
|
||||||
pancurses::endwin();
|
pancurses::endwin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user