nui 0.0.1

Experimental neovim RPC for UI clients
Documentation
use rmpv::Value;

use super::ParseError;

#[derive(Debug)]
pub enum WindowAnchor {
    NW,
    NE,
    SW,
    SE,
}

#[derive(Debug)]
pub struct WindowPosition {
    pub grid: i64,
    pub window: i64,
    pub start_row: i64,
    pub start_column: i64,
    pub width: i64,
    pub height: i64,
}

impl TryFrom<&Vec<Value>> for WindowPosition {
    type Error = ParseError;

    fn try_from(value: &Vec<Value>) -> Result<Self, Self::Error> {
        todo!()
    }
}

#[derive(Debug)]
pub struct WindowFloatPosition {
    pub grid: i64,
    pub window: i64,
    pub anchor: i64,
    pub anchor_grid: i64,
    pub anchor_row: i64,
    pub anchor_column: i64,
    pub focusable: bool,
}

#[derive(Debug)]
pub struct WindowExternalPosition {
    pub grid: i64,
    pub window: i64,
}

#[derive(Debug)]
pub struct WindowHide {
    pub grid: i64,
}

#[derive(Debug)]
pub struct WindowClose {
    pub grid: i64,
}

#[derive(Debug)]
pub struct WindowViewport {
    pub grid: i64,
    pub window: i64,
    pub top_line: i64,
    pub bottom_line: i64,
    pub cursor_line: i64,
    pub cursor_column: i64,
    pub line_count: i64,
    pub scroll_delta: i64,
}

impl TryFrom<&Vec<Value>> for WindowViewport {
    type Error = ParseError;

    fn try_from(values: &Vec<Value>) -> Result<Self, Self::Error> {
        dbg!(values);

        Err(ParseError::InvalidArray(Value::from("test")))
    }
}

#[derive(Debug)]
pub struct WindowExtmark {
    pub grid: i64,
    pub window: i64,
    pub ns_id: i64,
    pub mark_id: i64,
    pub row: i64,
    pub column: i64,
}