brick-filetree-0.1.0.2

Safe HaskellNone
LanguageHaskell2010

Brick.Widgets.FileTree

Contents

Synopsis

Types

data FileTree Source #

Represents all the state required to interact with or display a filetree

newFileTree :: FilePath -> IO FileTree Source #

Create a new FileTree situated at the given FilePath

Interaction

moveUp :: FileTree -> EventM String FileTree Source #

Move the cursor up one item

moveDown :: FileTree -> EventM String FileTree Source #

Move the cursor down one item

pageUp :: FileTree -> EventM String FileTree Source #

Move the cursor up a page

pageDown :: FileTree -> EventM String FileTree Source #

Move the cursor down a page

moveToTop :: FileTree -> EventM String FileTree Source #

Move the cursor the the top of the file list

moveToBottom :: FileTree -> EventM String FileTree Source #

Move the cursor the the bottom of the file list

ascendDir :: FileTree -> EventM String FileTree Source #

Move the cursor up a directory in the file tree

descendDir :: FileTree -> EventM String FileTree Source #

If the cursor is on a directory then descend the cursor into that dir If the cursor is on a file nothing happens

toggleFlagged :: FileTree -> EventM String FileTree Source #

Flag or unflag the current file or dir

toggleFlaggedVisible :: FileTree -> FileTree Source #

Hide/Show a list of all flagged files

Queries

getCurrentFilePath :: FileTree -> Maybe FilePath Source #

Get the absolute path of the object (dir or file) under the cursor

getCurrentDir :: FileTree -> FilePath Source #

Get the absolute path of the directory where the cursor currently is.

getFlagged :: FileTree -> [FilePath] Source #

Get all flagged file paths. All paths are absolute

Rendering

Attributes

flaggedItemAttr :: AttrName Source #

Flagged items are rendered with this attr

titleAttr :: AttrName Source #

UI Titles have this attr

dirAttr :: AttrName Source #

Directories in the list have this attr

fileAttr :: AttrName Source #

Files in the list have this attr

errorAttr :: AttrName Source #

Errors have this attr