Documentation
¶
Index ¶
- type Model
- func (s *Model) CancelSidebarRename()
- func (s *Model) ConfirmSidebarRename()
- func (m *Model) Disabled() bool
- func (s *Model) GetCurrentDirectoryLocation() string
- func (m *Model) GetHeight() int
- func (m *Model) GetWidth() int
- func (s *Model) HandleSearchBarKey(msg string)
- func (s *Model) IsRenaming() bool
- func (s *Model) ListDown()
- func (s *Model) ListUp()
- func (s *Model) NoActualDir() bool
- func (s *Model) PinnedItemRename()
- func (s *Model) Render(sidebarFocused bool, currentFilePanelLocation string) string
- func (s *Model) SearchBarBlur()
- func (s *Model) SearchBarFocus()
- func (s *Model) SearchBarFocused() bool
- func (m *Model) SetHeight(height int)
- func (s *Model) TogglePinnedDirectory(dir string) error
- func (s *Model) UpdateDirectories()
- func (s *Model) UpdateState(msg tea.Msg) tea.Cmd
- type PinnedManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func New ¶
func New() Model
New initializes and returns a new Model for the sidebar correctly set up with configuration.
func (*Model) CancelSidebarRename ¶
func (s *Model) CancelSidebarRename()
CancelSidebarRename aborts the rename process for a pinned directory.
func (*Model) ConfirmSidebarRename ¶
func (s *Model) ConfirmSidebarRename()
ConfirmSidebarRename finalizes the rename process and saves changes to the pinned directories file.
func (*Model) Disabled ¶ added in v1.5.0
Disabled returns true if the sidebar is currently disabled.
func (*Model) GetCurrentDirectoryLocation ¶
GetCurrentDirectoryLocation returns the location of the currently selected directory
func (*Model) HandleSearchBarKey ¶
HandleSearchBarKey processes key events specifically for the sidebar's search bar.
func (*Model) IsRenaming ¶
IsRenaming returns whether the sidebar is currently in renaming mode
func (*Model) NoActualDir ¶
NoActualDir returns true if the sidebar contains only dividers and no actual directories.
func (*Model) PinnedItemRename ¶
func (s *Model) PinnedItemRename()
PinnedItemRename initiates the rename process for the currently selected pinned directory.
func (*Model) SearchBarBlur ¶
func (s *Model) SearchBarBlur()
SearchBarBlur removes focus from the search bar
func (*Model) SearchBarFocus ¶
func (s *Model) SearchBarFocus()
SearchBarFocus sets focus on the search bar
func (*Model) SearchBarFocused ¶
SearchBarFocused returns whether the search bar is focused
func (*Model) SetHeight ¶ added in v1.5.0
SetHeight updates the height of the sidebar, ensuring it meets the minimum requirement.
func (*Model) TogglePinnedDirectory ¶ added in v1.4.0
TogglePinnedDirectory adds or removes a directory from the pinned list.
func (*Model) UpdateDirectories ¶
func (s *Model) UpdateDirectories()
UpdateDirectories refreshes the list of directories based on the search query or section configuration.
type PinnedManager ¶ added in v1.4.0
type PinnedManager struct {
// contains filtered or unexported fields
}
func NewPinnedFileManager ¶ added in v1.4.0
func NewPinnedFileManager(filePath string) PinnedManager
func (*PinnedManager) Clean ¶ added in v1.4.0
func (mgr *PinnedManager) Clean(dirs []directory) []directory
Clean removes non-existing directories and optionally saves the updated list
func (*PinnedManager) Load ¶ added in v1.4.0
func (mgr *PinnedManager) Load() []directory
Load reads the pinned directories from file and cleans non-existing ones
func (*PinnedManager) Save ¶ added in v1.4.0
func (mgr *PinnedManager) Save(dirs []directory) error
Save marshals and writes the pinned directories to file.
func (*PinnedManager) Toggle ¶ added in v1.4.0
func (mgr *PinnedManager) Toggle(dir string) error
Toggle adds or removes a directory from the pinned directories list