pub struct ExplorerState {Show 17 fields
pub tree: FileTree,
pub cursor_index: usize,
pub show_hidden: bool,
pub show_sizes: bool,
pub filter_text: String,
pub width: u16,
pub scroll_offset: usize,
pub visible_height: u16,
pub input_mode: ExplorerInputMode,
pub input_buffer: String,
pub message: Option<String>,
pub clipboard: ExplorerClipboard,
pub selection: ExplorerSelection,
pub visible: bool,
pub popup: FileDetailsPopup,
pub enable_colors: bool,
pub tree_style: TreeStyle,
}Expand description
State of the file explorer
Fields§
§tree: FileTreeThe file tree structure
cursor_index: usizeIndex of the currently selected item in the flattened view
Whether to show hidden files
show_sizes: boolWhether to show file sizes
filter_text: StringCurrent filter text
width: u16Width of the explorer panel
scroll_offset: usizeScroll offset for the view
visible_height: u16Visible height of the explorer window (set during render)
input_mode: ExplorerInputModeCurrent input mode
input_buffer: StringCurrent input buffer (for create/rename/filter)
message: Option<String>Message to display (e.g., error or confirmation prompt)
clipboard: ExplorerClipboardClipboard for copy/cut/paste operations
selection: ExplorerSelectionMulti-file selection state
visible: boolWhether the explorer is currently visible
popup: FileDetailsPopupFile details popup state
enable_colors: boolEnable file type syntax coloring
tree_style: TreeStyleTree drawing style for visual hierarchy
Implementations§
Source§impl ExplorerState
impl ExplorerState
Sourcepub fn is_input_mode(&self) -> bool
pub fn is_input_mode(&self) -> bool
Check if in input mode
Sourcepub fn toggle_visibility(&mut self)
pub fn toggle_visibility(&mut self)
Toggle explorer visibility
Sourcepub fn start_create_file(&mut self)
pub fn start_create_file(&mut self)
Start creating a new file
Sourcepub fn start_create_dir(&mut self)
pub fn start_create_dir(&mut self)
Start creating a new directory
Sourcepub fn start_rename(&mut self)
pub fn start_rename(&mut self)
Start renaming current item
Sourcepub fn start_delete(&mut self)
pub fn start_delete(&mut self)
Start delete confirmation
Sourcepub fn start_filter(&mut self)
pub fn start_filter(&mut self)
Start filter mode
Sourcepub fn cancel_input(&mut self)
pub fn cancel_input(&mut self)
Cancel current input mode
Sourcepub fn input_char(&mut self, c: char)
pub fn input_char(&mut self, c: char)
Add a character to input buffer
Sourcepub fn input_backspace(&mut self)
pub fn input_backspace(&mut self)
Remove last character from input buffer
Sourcepub fn confirm_input(&mut self) -> Result<()>
pub fn confirm_input(&mut self) -> Result<()>
Confirm current input operation
Sourcepub fn visible_nodes(&self) -> Vec<&FileNode>
pub fn visible_nodes(&self) -> Vec<&FileNode>
Get all visible nodes (respecting hidden files and filter)
Sourcepub fn current_node(&self) -> Option<&FileNode>
pub fn current_node(&self) -> Option<&FileNode>
Get the currently selected node
Sourcepub fn current_path(&self) -> Option<&Path>
pub fn current_path(&self) -> Option<&Path>
Get the path of the currently selected node
Sourcepub fn move_cursor(&mut self, delta: isize)
pub fn move_cursor(&mut self, delta: isize)
Move the cursor by a delta amount
Sourcepub const fn move_to_first(&mut self)
pub const fn move_to_first(&mut self)
Move cursor to the first item
Sourcepub fn move_to_last(&mut self)
pub fn move_to_last(&mut self)
Move cursor to the last item
Sourcepub fn toggle_current(&mut self) -> Result<()>
pub fn toggle_current(&mut self) -> Result<()>
Toggle expand/collapse on the current directory
Sourcepub fn expand_current(&mut self) -> Result<()>
pub fn expand_current(&mut self) -> Result<()>
Expand the current directory
Sourcepub fn collapse_current(&mut self)
pub fn collapse_current(&mut self)
Collapse the current directory
Sourcepub fn go_to_parent(&mut self)
pub fn go_to_parent(&mut self)
Go to parent directory (change root to parent and position cursor on old root)
This implements nvim-tree style navigation:
- Change explorer root to parent directory
- Position cursor on the directory we just came from
Sourcepub fn change_root_to_current(&mut self)
pub fn change_root_to_current(&mut self)
Change root to currently selected directory
If the current selection is a directory, make it the new root. If it’s a file, use its parent directory as the new root.
Sourcepub fn set_filter(&mut self, text: String)
pub fn set_filter(&mut self, text: String)
Set the filter text
Sourcepub fn clear_filter(&mut self)
pub fn clear_filter(&mut self)
Clear the filter
Toggle showing hidden files
Sourcepub const fn toggle_sizes(&mut self)
pub const fn toggle_sizes(&mut self)
Toggle showing file sizes
Sourcepub const fn set_visible_height(&mut self, height: u16)
pub const fn set_visible_height(&mut self, height: u16)
Set visible height (called from render)
Sourcepub const fn update_scroll(&mut self)
pub const fn update_scroll(&mut self)
Update scroll offset to keep cursor visible
Sourcepub fn show_file_details(&mut self)
pub fn show_file_details(&mut self)
Show file details popup for the current node
Sourcepub fn close_popup(&mut self)
pub fn close_popup(&mut self)
Close the file details popup
Sourcepub const fn is_popup_visible(&self) -> bool
pub const fn is_popup_visible(&self) -> bool
Check if popup is visible
Sourcepub fn sync_popup(&mut self)
pub fn sync_popup(&mut self)
Sync popup with current cursor position (update content if visible)
Sourcepub fn yank_current(&mut self)
pub fn yank_current(&mut self)
Yank (copy) current item to clipboard
Sourcepub fn cut_current(&mut self)
pub fn cut_current(&mut self)
Cut current item to clipboard
Sourcepub fn enter_visual_mode(&mut self)
pub fn enter_visual_mode(&mut self)
Enter visual selection mode
Sourcepub fn exit_visual_mode(&mut self)
pub fn exit_visual_mode(&mut self)
Exit visual selection mode
Sourcepub fn toggle_select_current(&mut self)
pub fn toggle_select_current(&mut self)
Toggle selection of current item
Sourcepub fn select_all(&mut self)
pub fn select_all(&mut self)
Select all visible items
Sourcepub fn update_visual_selection(&mut self)
pub fn update_visual_selection(&mut self)
Update visual selection when cursor moves
Sourcepub fn is_selected(&self, path: &Path) -> bool
pub fn is_selected(&self, path: &Path) -> bool
Check if a path is selected
Sourcepub fn yank_selected(&mut self)
pub fn yank_selected(&mut self)
Yank selected items to clipboard (for multi-selection)
Sourcepub fn cut_selected(&mut self)
pub fn cut_selected(&mut self)
Cut selected items (for multi-selection)
Trait Implementations§
Source§impl Clone for ExplorerState
impl Clone for ExplorerState
Source§fn clone(&self) -> ExplorerState
fn clone(&self) -> ExplorerState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more