Skip to main content

move_down

Macro move_down 

Source
macro_rules! move_down {
    ($n:literal) => { ... };
    ($n:expr) => { ... };
}
Expand description

Moves cursor down by N positions.

Equivalent to CSI Pn B.

If used with literal, produces &'static str, otherwise produces String.

§Example

assert_eq!(formatc!("{'mu5}"), codes::move_up!(5));
assert_eq!(formatc!("{'md5}"), codes::move_down!(5));
assert_eq!(formatc!("{'mu}"), codes::move_up!(1));
assert_eq!(formatc!("{'md}"), codes::move_down!(1));

printcln!("{'clear}\n\nhello{'mu2}up{'md}down{'md}");

§Result in terminal