pub struct FileViewer { /* private fields */ }
Expand description
File viewer component for displaying and editing files
Implementations§
Source§impl FileViewer
impl FileViewer
Sourcepub fn new(config: &FileViewerConfig, theme: &dyn Theme) -> Self
pub fn new(config: &FileViewerConfig, theme: &dyn Theme) -> Self
Create a new file viewer
Sourcepub fn close_file(&mut self)
pub fn close_file(&mut self)
Close the current file
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Check if the file viewer is visible
Sourcepub fn current_file_path(&self) -> Option<&str>
pub fn current_file_path(&self) -> Option<&str>
Get the current file path
Sourcepub fn toggle_diff_style(&mut self)
pub fn toggle_diff_style(&mut self)
Toggle diff style between unified and side-by-side
Sourcepub async fn handle_key_event(&mut self, key: KeyEvent) -> Result<()>
pub async fn handle_key_event(&mut self, key: KeyEvent) -> Result<()>
Handle key events
Sourcepub fn scroll_down(&mut self)
pub fn scroll_down(&mut self)
Scroll down
Sourcepub fn update_theme(&mut self, theme: &dyn Theme)
pub fn update_theme(&mut self, theme: &dyn Theme)
Update theme
Auto Trait Implementations§
impl !Freeze for FileViewer
impl !RefUnwindSafe for FileViewer
impl Send for FileViewer
impl Sync for FileViewer
impl Unpin for FileViewer
impl !UnwindSafe for FileViewer
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> 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