diff options
author | rabite <rabite@posteo.de> | 2019-02-01 02:45:50 +0100 |
---|---|---|
committer | rabite <rabite@posteo.de> | 2019-02-01 02:45:50 +0100 |
commit | ea77d6f45a55bf1992c5b5237c73b8ca92bb2114 (patch) | |
tree | aa48d3f67955525578206a11c96dc098744dd0ff /src/term.rs | |
parent | 1e6719fe3368068217968fe0b637604668cb7764 (diff) |
show correct directory on left at start
Diffstat (limited to 'src/term.rs')
-rw-r--r-- | src/term.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/term.rs b/src/term.rs index ed8380b..bbd8806 100644 --- a/src/term.rs +++ b/src/term.rs @@ -16,14 +16,14 @@ pub trait ScreenExt: Write { impl ScreenExt for AlternateScreen<Box<Stdout>> {} -pub fn xsize() -> usize { +pub fn xsize() -> u16 { let (xsize, _) = termion::terminal_size().unwrap(); - xsize as usize + xsize } -pub fn ysize() -> usize { +pub fn ysize() -> u16 { let (_, ysize) = termion::terminal_size().unwrap(); - ysize as usize + ysize } pub fn sized_string(string: &str, xsize: u16) -> String { @@ -69,12 +69,12 @@ pub fn from_lscolor(color: &lscolors::Color) -> String { } } -pub fn cursor_left(n: usize) -> String { - format!("{}", termion::cursor::Left(n as u16)) +pub fn cursor_left(n: u16) -> String { + format!("{}", termion::cursor::Left(n)) } -pub fn gotoy(y: usize) -> String { - format!("{}", termion::cursor::Goto(1, y as u16)) +pub fn gotoy(y: u16) -> String { + format!("{}", termion::cursor::Goto(1, y)) } pub fn goto_xy(x: u16, y: u16) -> String { |