Layout

Struct Layout 

Source
pub struct Layout { /* private fields */ }
Expand description

Layout is a screen layout of the windows available for displaying buffer content to the user. The available screen space is split into a number of columns each containing a vertical stack of windows.

Implementations§

Source§

impl Layout

Source

pub fn new_with_stub_lsp_handle( screen_rows: usize, screen_cols: usize, config: Arc<RwLock<Config>>, ) -> Self

Source

pub fn active_buffer(&self) -> &Buffer

Returns the active buffer or the scratch buffer if it is focused

Source

pub fn open_or_focus<P: AsRef<Path>>( &mut self, path: P, new_window: bool, ) -> Result<Option<BufferId>>

Source

pub fn focus_column_for_resize(&mut self, col_idx: usize)

Focus the column at the given index without recording a jump.

§Panics

Panics if col_idx is out of bounds.

Source

pub fn focus_window_for_resize(&mut self, win_idx: usize)

Focus the window at the given index within the currently focused column, without recording a jump.

§Panics

Panics if win_idx is out of bounds.

Source

pub fn focus_column_and_window_for_resize( &mut self, col_idx: usize, win_idx: usize, )

Focus the column and window at the given indices without recording a jump.

§Panics

Panics if either index is out of bounds.

Source

pub fn resize_active_column_against_next(&mut self, delta: i16)

Resize the active column against the column to its right.

Source

pub fn resize_active_window_against_next(&mut self, delta: i16)

Resize the active window against the window below it.

Source

pub fn border_at_coords(&self, x: usize, y: usize) -> Option<Border>

Source

pub fn scroll_view(&mut self, x: usize, y: usize, up: bool, scroll_rows: usize)

Scroll the View under the given cursor coordinates up or down by scroll_rows

Trait Implementations§

Source§

impl Debug for Layout

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Layout

§

impl !RefUnwindSafe for Layout

§

impl Send for Layout

§

impl !Sync for Layout

§

impl Unpin for Layout

§

impl UnwindSafe for Layout

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more