Documentation
¶
Index ¶
- func TogglePinnedDirectory(dir string) error
- type Model
- func (s *Model) CancelSidebarRename()
- func (s *Model) ConfirmSidebarRename()
- func (s *Model) GetCurrentDirectoryLocation() string
- func (s *Model) HandleSearchBarKey(msg string)
- func (s *Model) IsRenaming() bool
- func (s *Model) ListDown(mainPanelHeight int)
- func (s *Model) ListUp(mainPanelHeight int)
- func (s *Model) NoActualDir() bool
- func (s *Model) PinnedItemRename()
- func (s *Model) Render(mainPanelHeight int, sidebarFocussed bool, currentFilePanelLocation string) string
- func (s *Model) SearchBarBlur()
- func (s *Model) SearchBarFocus()
- func (s *Model) SearchBarFocused() bool
- func (s *Model) UpdateDirectories()
- func (s *Model) UpdateState(msg tea.Msg) tea.Cmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TogglePinnedDirectory ¶
TogglePinnedDirectory adds or removes a directory from the pinned directories list
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) CancelSidebarRename ¶
func (s *Model) CancelSidebarRename()
Cancel rename pinned directory
func (*Model) ConfirmSidebarRename ¶
func (s *Model) ConfirmSidebarRename()
Confirm rename pinned directory
func (*Model) GetCurrentDirectoryLocation ¶
GetCurrentDirectoryLocation returns the location of the currently selected directory
func (*Model) HandleSearchBarKey ¶
HandleSearchBarKey handles key events for the sidebar search bar
func (*Model) IsRenaming ¶
IsRenaming returns whether the sidebar is currently in renaming mode
func (*Model) NoActualDir ¶
True if only dividers are in directories slice, but no actual directories This will be pretty quick. But we can replace it with len(s.directories) <= 2 - More hacky and hardcoded-like, but faster
func (*Model) PinnedItemRename ¶
func (s *Model) PinnedItemRename()
Rename file where the cursor is located
func (*Model) Render ¶
func (s *Model) Render(mainPanelHeight int, sidebarFocussed bool, currentFilePanelLocation string) string
Render returns the rendered sidebar string
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) UpdateDirectories ¶
func (s *Model) UpdateDirectories()
UpdateDirectories updates the directories list based on search value This is a bit inefficient, as we already had the directories when we initialized the sidebar. We call the directory fetching logic many times which is a disk heavy operation.