1 //! This module provides cursor related ANSI escape codes.
2 
3 use crate::csi;
4 
move_to_csi_sequence(x: u16, y: u16) -> String5 pub(crate) fn move_to_csi_sequence(x: u16, y: u16) -> String {
6     format!(csi!("{};{}H"), y + 1, x + 1)
7 }
8 
move_up_csi_sequence(count: u16) -> String9 pub(crate) fn move_up_csi_sequence(count: u16) -> String {
10     format!(csi!("{}A"), count)
11 }
12 
move_right_csi_sequence(count: u16) -> String13 pub(crate) fn move_right_csi_sequence(count: u16) -> String {
14     format!(csi!("{}C"), count)
15 }
16 
move_down_csi_sequence(count: u16) -> String17 pub(crate) fn move_down_csi_sequence(count: u16) -> String {
18     format!(csi!("{}B"), count)
19 }
20 
move_left_csi_sequence(count: u16) -> String21 pub(crate) fn move_left_csi_sequence(count: u16) -> String {
22     format!(csi!("{}D"), count)
23 }
24 
25 pub(crate) static SAVE_POSITION_CSI_SEQUENCE: &'static str = "\x1B7";
26 pub(crate) static RESTORE_POSITION_CSI_SEQUENCE: &'static str = "\x1B8";
27 pub(crate) static HIDE_CSI_SEQUENCE: &'static str = csi!("?25l");
28 pub(crate) static SHOW_CSI_SEQUENCE: &'static str = csi!("?25h");
29 pub(crate) static ENABLE_BLINKING_CSI_SEQUENCE: &'static str = csi!("?12h");
30 pub(crate) static DISABLE_BLINKING_CSI_SEQUENCE: &'static str = csi!("?12l");
31