One more go at fixing scroll textarea in windows

This commit is contained in:
Jonathan Turner 2019-07-25 14:43:51 +12:00
parent 501482cc31
commit f2873edf6c
2 changed files with 16 additions and 1 deletions

View file

@ -6,6 +6,7 @@ use nu::{
Value,
};
use pretty_hex::*;
use std::{thread, time::Duration};
struct BinaryView;
@ -444,6 +445,9 @@ pub fn view_contents_interactive(
#[allow(unused)]
let screen = RawScreen::disable_raw_mode();
println!("");
thread::sleep(Duration::from_millis(50));
Ok(())
}

View file

@ -87,6 +87,9 @@ fn scroll_view_lines(lines: Vec<String>) {
let cursor = cursor();
let _ = cursor.hide();
let input = crossterm::input();
let _ = input.read_async();
let mut size = paint_textview(&lines, starting_row);
loop {
if rawkey.is_pressed(rawkey::KeyCode::Escape) {
@ -110,7 +113,15 @@ fn scroll_view_lines(lines: Vec<String>) {
let _ = cursor.show();
}
thread::sleep(Duration::from_millis(250));
let cursor = cursor();
let _ = cursor.show();
#[allow(unused)]
let screen = RawScreen::disable_raw_mode();
println!("");
thread::sleep(Duration::from_millis(50));
}
fn scroll_view(s: &str) {