pub struct BufferHandler { /* private fields */ }
Expand description
Handles all buffer-related operations
Implementations§
Source§impl BufferHandler
impl BufferHandler
pub fn new() -> Self
Sourcepub fn next_buffer(&mut self, manager: &mut BufferManager) -> String
pub fn next_buffer(&mut self, manager: &mut BufferManager) -> String
Switch to next buffer
Sourcepub fn previous_buffer(&mut self, manager: &mut BufferManager) -> String
pub fn previous_buffer(&mut self, manager: &mut BufferManager) -> String
Switch to previous buffer
Sourcepub fn quick_switch(&mut self, manager: &mut BufferManager) -> String
pub fn quick_switch(&mut self, manager: &mut BufferManager) -> String
Quick switch between last two buffers (like vim’s Ctrl+6)
Sourcepub fn switch_to_buffer(
&mut self,
manager: &mut BufferManager,
index: usize,
) -> String
pub fn switch_to_buffer( &mut self, manager: &mut BufferManager, index: usize, ) -> String
Switch to specific buffer by index (0-based)
Sourcepub fn new_buffer(
&mut self,
manager: &mut BufferManager,
config: &Config,
) -> String
pub fn new_buffer( &mut self, manager: &mut BufferManager, config: &Config, ) -> String
Create a new buffer
Sourcepub fn close_buffer(&mut self, manager: &mut BufferManager) -> (bool, String)
pub fn close_buffer(&mut self, manager: &mut BufferManager) -> (bool, String)
Close current buffer
Sourcepub fn list_buffers(&self, manager: &BufferManager) -> Vec<String>
pub fn list_buffers(&self, manager: &BufferManager) -> Vec<String>
List all buffers with their status
Sourcepub fn get_history(&self) -> &[usize]
pub fn get_history(&self) -> &[usize]
Get buffer history
Sourcepub fn clear_history(&mut self)
pub fn clear_history(&mut self)
Clear buffer history
Auto Trait Implementations§
impl Freeze for BufferHandler
impl RefUnwindSafe for BufferHandler
impl Send for BufferHandler
impl Sync for BufferHandler
impl Unpin for BufferHandler
impl UnwindSafe for BufferHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more