Commit c136c8f2 authored by Moritz Sokoll's avatar Moritz Sokoll 🦀
Browse files

fixed cursor stuff

parent f48fe317
[package]
name = "btui"
version = "0.4.3"
version = "0.4.4"
edition = "2018"
authors = ["Moritz Sokoll <moritz@sokoll.com>"]
license = "MIT"
......
......@@ -5,7 +5,7 @@
## Usage
Add this to your `Cargo.toml` dependency list:
```toml
btui = "0.4.3"
btui = "0.4.4"
```
## Features
This crate supports some different features:
......
......@@ -4,7 +4,7 @@
//! with btui you can create beautiful text user interfaces for the terminal.
//! To get started add `btui` as a dependency to your project:
//! ```toml
//! btui = "0.4.3"
//! btui = "0.4.4"
//! ```
#[cfg(feature = "core")]
......
......@@ -28,9 +28,9 @@ pub mod console {
/// *`sequence`: sequence to perform
pub fn dc_sequence(sequence: DisplayControl) {
let seq: String = match sequence {
Clear => String::from("\x1b[2J"),
ClearLine => String::from("\x1b[2K"),
Reset => String::from("\x1bc")
DisplayControl::Clear => String::from("\x1b[2J"),
DisplayControl::ClearLine => String::from("\x1b[2K"),
DisplayControl::Reset => String::from("\x1bc")
};
print!("{}", seq);
......@@ -41,12 +41,12 @@ pub mod console {
/// *`sequence`: the sequence to perform
pub fn cc_sequence(sequence: CursorControl) {
let seq: String = match sequence {
Left(n) => format!("\x1b[{}D", n),
Right(n) => format!("\x1b[{}C", n),
Col(n) => format!("\x1b[{}G", n),
Up(n) => format!("\x1b[{}A"),
Down(n) => format!("\x1b[{}B", n),
Pos(x, y) => format!("\x1b[{};{}H", x, y),
CursorControl::Left(n) => format!("\x1b[{}D", n),
CursorControl::Right(n) => format!("\x1b[{}C", n),
CursorControl::Col(n) => format!("\x1b[{}G", n),
CursorControl::Up(n) => format!("\x1b[{}A"),
CursorControl::Down(n) => format!("\x1b[{}B", n),
CursorControl::Pos(x, y) => format!("\x1b[{};{}H", x, y),
};
print!("{}", seq);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment