2
0
Fork 0
mirror of https://github.com/nushell/nushell synced 2025-01-16 23:24:14 +00:00

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

View file

@ -87,6 +87,9 @@ fn scroll_view_lines(lines: Vec<String>) {
let cursor = cursor(); let cursor = cursor();
let _ = cursor.hide(); let _ = cursor.hide();
let input = crossterm::input();
let _ = input.read_async();
let mut size = paint_textview(&lines, starting_row); let mut size = paint_textview(&lines, starting_row);
loop { loop {
if rawkey.is_pressed(rawkey::KeyCode::Escape) { if rawkey.is_pressed(rawkey::KeyCode::Escape) {
@ -110,7 +113,15 @@ fn scroll_view_lines(lines: Vec<String>) {
let _ = cursor.show(); 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) { fn scroll_view(s: &str) {