Struct State

Source
pub struct State {
Show 23 fields pub grids: GridMap, mouse_enabled: bool, nvim: Rc<NeovimClient>, cursor: Option<BlinkCursor<State>>, popup_menu: PopupMenu, cmd_line: CmdLine, settings: Rc<RefCell<Settings>>, render_state: Rc<RefCell<RenderState>>, resize_request: (i64, i64), resize_timer: Rc<Cell<Option<SourceId>>>, pub clipboard_clipboard: Clipboard, pub clipboard_primary: Clipboard, stack: Stack, pub drawing_area: DrawingArea, tabs: Tabline, im_context: IMMulticontext, error_area: ErrorArea, options: ShellOptions, transparency_settings: TransparencySettigns, detach_cb: Option<Box<RefCell<dyn FnMut() + Send + 'static>>>, nvim_started_cb: Option<Box<RefCell<dyn FnMut() + Send + 'static>>>, command_cb: Option<Box<dyn FnMut(&mut State, NvimCommand) + Send + 'static>>, subscriptions: RefCell<Subscriptions>,
}

Fields§

§grids: GridMap§mouse_enabled: bool§nvim: Rc<NeovimClient>§cursor: Option<BlinkCursor<State>>§popup_menu: PopupMenu§cmd_line: CmdLine§settings: Rc<RefCell<Settings>>§render_state: Rc<RefCell<RenderState>>§resize_request: (i64, i64)§resize_timer: Rc<Cell<Option<SourceId>>>§clipboard_clipboard: Clipboard§clipboard_primary: Clipboard§stack: Stack§drawing_area: DrawingArea§tabs: Tabline§im_context: IMMulticontext§error_area: ErrorArea§options: ShellOptions§transparency_settings: TransparencySettigns§detach_cb: Option<Box<RefCell<dyn FnMut() + Send + 'static>>>§nvim_started_cb: Option<Box<RefCell<dyn FnMut() + Send + 'static>>>§command_cb: Option<Box<dyn FnMut(&mut State, NvimCommand) + Send + 'static>>§subscriptions: RefCell<Subscriptions>

Implementations§

Source§

impl State

Source

pub fn new(settings: Rc<RefCell<Settings>>, options: ShellOptions) -> State

Source

pub fn nvim_non_blocked(&self) -> Option<NeovimRef<'_>>

Return NeovimRef only if vim in non blocking state

Note that this call also do neovim api call get_mode

Source

pub fn nvim(&self) -> Option<NeovimRef<'_>>

Source

pub fn try_nvim(&self) -> Option<NeovimRef<'_>>

Source

pub fn nvim_clone(&self) -> Rc<NeovimClient>

Source

pub fn start_nvim_initialization(&self) -> bool

Source

pub fn set_detach_cb<F>(&mut self, cb: Option<F>)
where F: FnMut() + Send + 'static,

Source

pub fn set_nvim_started_cb<F>(&mut self, cb: Option<F>)
where F: FnMut() + Send + 'static,

Source

pub fn set_nvim_command_cb<F>(&mut self, cb: Option<F>)
where F: FnMut(&mut State, NvimCommand) + Send + 'static,

Source

pub fn set_font_desc(&mut self, desc: &str)

Source

pub fn set_font_features(&mut self, font_features: String)

Source

pub fn set_line_space(&mut self, line_space: String)

Source

pub fn set_transparency( &mut self, background_alpha: f64, filled_alpha: f64, ) -> bool

return true if transparency enabled

Source

pub fn open_file(&self, path: &str)

Source

pub fn cd(&self, path: &str)

Source

pub fn clipboard_clipboard_set(&self, text: &str)

Source

pub fn clipboard_primary_set(&self, text: &str)

Source

fn close_popup_menu(&self)

Source

fn queue_draw_area<M: AsRef<ModelRect>>(&mut self, rect_list: &[M])

Source

fn update_dirty_glyphs(&mut self)

Source

fn im_commit(&self, ch: &str)

Source

fn calc_nvim_size(&self) -> (usize, usize)

Source

fn show_error_area(&self)

Source

fn set_im_location(&self)

Source

fn try_nvim_resize(&mut self)

Source

fn edit_paste(&self, clipboard: &str)

Source

fn edit_copy(&self, clipboard: &str)

Source

fn max_popup_width(&self) -> i32

Source

pub fn subscribe<F>( &self, key: SubscriptionKey, args: &[&str], cb: F, ) -> SubscriptionHandle
where F: Fn(Vec<String>) + 'static,

Source

pub fn set_autocmds(&self)

Source

pub fn notify(&self, params: Vec<Value>) -> Result<(), String>

Source

pub fn run_now(&self, handle: &SubscriptionHandle)

Source

pub fn set_font(&mut self, font_desc: String)

Source

pub fn set_font_rpc(&mut self, font_desc: &str)

Source

pub fn on_command(&mut self, command: NvimCommand)

Source§

impl State

Source

pub fn grid_line( &mut self, grid: u64, row: u64, col_start: u64, cells: Vec<Vec<Value>>, ) -> RepaintMode

Source

pub fn grid_clear(&mut self, grid: u64) -> RepaintMode

Source

pub fn grid_destroy(&mut self, grid: u64) -> RepaintMode

Source

pub fn grid_cursor_goto( &mut self, grid: u64, row: u64, column: u64, ) -> RepaintMode

Source

pub fn grid_resize(&mut self, grid: u64, columns: u64, rows: u64) -> RepaintMode

Source

pub fn on_redraw(&mut self, mode: &RepaintMode)

Source

pub fn grid_scroll( &mut self, grid: u64, top: u64, bot: u64, left: u64, right: u64, rows: i64, cols: i64, ) -> RepaintMode

Source

pub fn hl_attr_define( &mut self, id: u64, rgb_attr: HashMap<String, Value>, _: &Value, info: Vec<HashMap<String, Value>>, ) -> RepaintMode

Source

pub fn default_colors_set( &mut self, fg: i64, bg: i64, sp: i64, cterm_fg: i64, cterm_bg: i64, ) -> RepaintMode

Source

fn cur_point_area(&self) -> RepaintMode

Source

pub fn on_mode_change(&mut self, mode: String, idx: u64) -> RepaintMode

Source

pub fn on_mouse(&mut self, on: bool) -> RepaintMode

Source

pub fn on_busy(&mut self, busy: bool) -> RepaintMode

Source

pub fn popupmenu_show( &mut self, menu: &[CompleteItem<'_>], selected: i64, row: u64, col: u64, ) -> RepaintMode

Source

pub fn popupmenu_hide(&mut self) -> RepaintMode

Source

pub fn popupmenu_select(&mut self, selected: i64) -> RepaintMode

Source

pub fn tabline_update( &mut self, selected: Tabpage, tabs: Vec<(Tabpage, Option<String>)>, ) -> RepaintMode

Source

pub fn option_set(&mut self, name: String, val: Value) -> RepaintMode

Source

fn set_font_from_value(&mut self, val: Value)

Source

pub fn mode_info_set( &mut self, cursor_style_enabled: bool, mode_infos: Vec<HashMap<String, Value>>, ) -> RepaintMode

Source

pub fn cmdline_show( &mut self, content: Vec<(u64, String)>, pos: u64, firstc: String, prompt: String, indent: u64, level: u64, ) -> RepaintMode

Source

pub fn cmdline_hide(&mut self, level: u64) -> RepaintMode

Source

pub fn cmdline_block_show( &mut self, content: Vec<Vec<(u64, String)>>, ) -> RepaintMode

Source

pub fn cmdline_block_append( &mut self, content: Vec<(u64, String)>, ) -> RepaintMode

Source

pub fn cmdline_block_hide(&mut self) -> RepaintMode

Source

pub fn cmdline_pos(&mut self, pos: u64, level: u64) -> RepaintMode

Source

pub fn cmdline_special_char( &mut self, c: String, shift: bool, level: u64, ) -> RepaintMode

Source

pub fn wildmenu_show(&self, items: Vec<String>) -> RepaintMode

Source

pub fn wildmenu_hide(&self) -> RepaintMode

Source

pub fn wildmenu_select(&self, selected: i64) -> RepaintMode

Trait Implementations§

Auto Trait Implementations§

§

impl !Freeze for State

§

impl !RefUnwindSafe for State

§

impl !Send for State

§

impl !Sync for State

§

impl Unpin for State

§

impl !UnwindSafe for State

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.