mirror of
https://github.com/Xyverle/neutuino.git
synced 2026-06-26 22:03:13 -04:00
0.2.0
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
#![warn(clippy::all, clippy::pedantic)]
|
||||
|
||||
use std::{time::Duration, io};
|
||||
use neutuino::ansi::{COLORS_BG, COLORS_FG, STYLE_BOLD, STYLE_ITALIC, STYLE_RESET, STYLE_UNDERLINE, move_cursor_to_column, set_window_title};
|
||||
use neutuino::os::{enable_ansi, get_terminal_size};
|
||||
use neutuino::input::{poll_input, Event, KeyEvent};
|
||||
|
||||
use neutuino::ansi::{
|
||||
COLORS_BG, COLORS_FG, STYLE_BOLD, STYLE_ITALIC, STYLE_RESET, STYLE_UNDERLINE,
|
||||
move_cursor_to_column, set_window_title,
|
||||
};
|
||||
use neutuino::input::{Event, KeyEvent, poll_input};
|
||||
use neutuino::os::{disable_raw_mode, enable_ansi, enable_raw_mode, get_terminal_size};
|
||||
use std::{io, time::Duration};
|
||||
|
||||
fn print_line_style_reset(string: &str) {
|
||||
println!("{}{}{}", string, STYLE_RESET, move_cursor_to_column(0));
|
||||
@@ -12,8 +14,9 @@ fn print_line_style_reset(string: &str) {
|
||||
|
||||
fn main() -> io::Result<()> {
|
||||
let all_styles = format!("{STYLE_BOLD}{STYLE_ITALIC}{STYLE_UNDERLINE}");
|
||||
let _raw_terminal = neutuino::os::RawTerminal::new()?;
|
||||
|
||||
enable_ansi()?;
|
||||
enable_raw_mode()?;
|
||||
|
||||
println!("q to quit{}", move_cursor_to_column(0));
|
||||
let next = |x: usize| (x + 1) % COLORS_FG.len();
|
||||
@@ -42,5 +45,6 @@ fn main() -> io::Result<()> {
|
||||
}
|
||||
counter = next(counter);
|
||||
}
|
||||
disable_raw_mode()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user