fix merge confilict
This commit is contained in:
commit
86a82a33cd
@ -25,6 +25,7 @@ use crossterm::Terminal;
|
|||||||
use std::{thread, time};
|
use std::{thread, time};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
<<<<<<< HEAD
|
||||||
let term = Terminal::new();
|
let term = Terminal::new();
|
||||||
let mut cursor = term.cursor();
|
let mut cursor = term.cursor();
|
||||||
cursor.goto(10,10);
|
cursor.goto(10,10);
|
||||||
@ -34,3 +35,11 @@ fn main() {
|
|||||||
let line = stdin.read_line();
|
let line = stdin.read_line();
|
||||||
println!("{:?}", line)
|
println!("{:?}", line)
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
{
|
||||||
|
let mut terminal = Terminal::new();
|
||||||
|
terminal.enable_alternate_screen();
|
||||||
|
thread::sleep(time::Duration::from_millis(5000));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>>>>>>> 403d0668a72e9ca04a05bbe137a30d6a2d9ba90c
|
||||||
|
@ -13,13 +13,21 @@ use std::rc::Rc;
|
|||||||
|
|
||||||
/// Struct that stores an specific platform implementation for cursor related actions.
|
/// Struct that stores an specific platform implementation for cursor related actions.
|
||||||
pub struct TerminalCursor<'cursor> {
|
pub struct TerminalCursor<'cursor> {
|
||||||
|
<<<<<<< HEAD
|
||||||
screen_manager: &'cursor ScreenManager,
|
screen_manager: &'cursor ScreenManager,
|
||||||
|
=======
|
||||||
|
context: &'cursor ScreenManager,
|
||||||
|
>>>>>>> 403d0668a72e9ca04a05bbe137a30d6a2d9ba90c
|
||||||
terminal_cursor: Box<ITerminalCursor>,
|
terminal_cursor: Box<ITerminalCursor>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'cursor> TerminalCursor<'cursor> {
|
impl<'cursor> TerminalCursor<'cursor> {
|
||||||
/// Create new cursor instance whereon cursor related actions can be performed.
|
/// Create new cursor instance whereon cursor related actions can be performed.
|
||||||
|
<<<<<<< HEAD
|
||||||
pub fn new(screen_manager: &'cursor ScreenManager) -> TerminalCursor<'cursor> {
|
pub fn new(screen_manager: &'cursor ScreenManager) -> TerminalCursor<'cursor> {
|
||||||
|
=======
|
||||||
|
pub fn new(context: &'cursor ScreenManager) -> TerminalCursor<'cursor> {
|
||||||
|
>>>>>>> 403d0668a72e9ca04a05bbe137a30d6a2d9ba90c
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
let cursor = functions::get_module::<Box<ITerminalCursor>>(
|
let cursor = functions::get_module::<Box<ITerminalCursor>>(
|
||||||
WinApiCursor::new(),
|
WinApiCursor::new(),
|
||||||
|
@ -62,6 +62,5 @@ impl ITerminalCursor for WinApiCursor {
|
|||||||
fn show(&self, screen_manager: &ScreenManager) {
|
fn show(&self, screen_manager: &ScreenManager) {
|
||||||
cursor::cursor_visibility(true, screen_manager);
|
cursor::cursor_visibility(true, screen_manager);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn blink(&self, blink: bool, screen_manager: &ScreenManager) {}
|
fn blink(&self, blink: bool, screen_manager: &ScreenManager) {}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,9 @@ pub mod terminal;
|
|||||||
|
|
||||||
pub use shared::Terminal::Terminal;
|
pub use shared::Terminal::Terminal;
|
||||||
//pub use shared::crossterm::Crossterm;
|
//pub use shared::crossterm::Crossterm;
|
||||||
|
|
||||||
|
pub use shared::crossterm::Crossterm;
|
||||||
|
|
||||||
pub use shared::raw;
|
pub use shared::raw;
|
||||||
pub use shared::screen;
|
pub use shared::screen;
|
||||||
pub use state::context::Context;
|
pub use state::context::Context;
|
||||||
|
@ -2,12 +2,12 @@ use {StateManager, ScreenManager};
|
|||||||
use super::super::state::commands::*;
|
use super::super::state::commands::*;
|
||||||
use super::raw::RawTerminal;
|
use super::raw::RawTerminal;
|
||||||
use super::screen::AlternateScreen;
|
use super::screen::AlternateScreen;
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
use super::super::cursor;
|
use super::super::cursor;
|
||||||
use super::super::input;
|
use super::super::input;
|
||||||
use super::super::terminal;
|
use super::super::terminal;
|
||||||
|
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use std::io::Result;
|
use std::io::Result;
|
||||||
@ -99,7 +99,6 @@ impl Terminal{
|
|||||||
|
|
||||||
return Ok(())
|
return Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn cursor(&self) -> cursor::TerminalCursor {
|
pub fn cursor(&self) -> cursor::TerminalCursor {
|
||||||
cursor::TerminalCursor::new(&self.active_screen)
|
cursor::TerminalCursor::new(&self.active_screen)
|
||||||
}
|
}
|
||||||
|
@ -154,6 +154,17 @@ impl IAlternateScreenCommand for ToAlternateScreenBufferCommand {
|
|||||||
Some(b) => b.set_alternate_handle(new_handle),
|
Some(b) => b.set_alternate_handle(new_handle),
|
||||||
None => return Err(Error::new(ErrorKind::Other,"Invalid cast exception")),
|
None => return Err(Error::new(ErrorKind::Other,"Invalid cast exception")),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let b: &mut WinApiScreenManager = match screen_manager
|
||||||
|
.as_any()
|
||||||
|
.downcast_mut::<WinApiScreenManager>()
|
||||||
|
{
|
||||||
|
Some(b) => b,
|
||||||
|
None => return Err(Error::new(ErrorKind::Other,"Invalid cast exception")),
|
||||||
|
};
|
||||||
|
|
||||||
|
b.set_alternate_handle(new_handle);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user