pub fn parse_relative_y(y: i16) -> Result<i16> {
    let window = ScreenBuffer::current()?.info()?;

    let window_size = window.terminal_window();
    let screen_size = window.terminal_size();

    if y <= screen_size.height {
        Ok(y)
    } else {
        Ok(y - window_size.top)
    }
}
// The 'y' position of the cursor is not relative to the window but absolute to screen buffer.
// We can calculate the relative cursor position by subtracting the top position of the terminal window from the y position.
// This results in an 1-based coord zo subtract 1 to make cursor position 0-based.
The 'y' position of the cursor is not relative to the window but absolute to screen buffer.
We can calculate the relative cursor position by subtracting the top position of the terminal window from the y position.
This results in an 1-based coord zo subtract 1 to make cursor position 0-based.
The ' y ' position of the cursor is not relative to the window but absolute to screen buffer . We can calculate the relative cursor position by subtracting the top position of the terminal window from the y position . This results in an 1 - based coord zo subtract 1 to make cursor position 0 - based .
pub fn parse_relative_y(y: i16) -> Result<i16> {
    let window = ScreenBuffer::current()?.info()?;
    let window_size = window.terminal_window();
    let screen_size = window.terminal_size();
    if y <= screen_size.height {
        Ok(y)
    } else {
        Ok(y - window_size.top)
    }
}
pub fn parse_relative_y ( y : i16 ) -> Result < i16 > { let window = ScreenBuffer :: current ( ) ? . info ( ) ? ; let window_size = window . terminal_window ( ) ; let screen_size = window . terminal_size ( ) ; if y <= screen_size . height { Ok ( y ) } else { Ok ( y - window_size . top ) } }
The 'y' position of the cursor is not relative to the window but absolute to screen buffer.
The ' y ' position of the cursor is not relative to the window but absolute to screen buffer .
y
i16
y
i16