app

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

The app package handles the main application logic.

Partially inspired by:

https://github.com/nsf/termbox-go/blob/master/_demos/editbox.go
https://github.com/gdamore/tcell/blob/master/TUTORIAL.md

should store formatted strings so they don't need to be processed each refresh

Dealing with complex formatting for display

Parsing git stuff

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	*fst.Directory
	Layout
	Config
	Path *fst.Path
	// contains filtered or unexported fields
}

Main object managing the app functionality and display.

func NewApp

func NewApp(s tcell.Screen, c Config) *App

func (*App) Draw

func (app *App) Draw(s tcell.Screen)

this should handle all drawing on the screen

func (*App) Index

func (app *App) Index() int

func (*App) Refresh

func (app *App) Refresh(s tcell.Screen)

func (*App) ShiftDown added in v0.1.0

func (app *App) ShiftDown()

func (*App) ShiftUp added in v0.1.0

func (app *App) ShiftUp()

func (*App) Walk added in v0.1.0

func (app *App) Walk(p *fst.Path)

func (*App) WalkToChild added in v0.1.0

func (app *App) WalkToChild()

Move to the current selection if it's a directory, otherwise do nothing.

type Config

type Config struct {
	ShowHidden bool      `yaml:"show-hidden"`
	UseEmoji   bool      `yaml:"use-emoji"`
	InitDir    *fst.Path // where scry is initialized
	Home       *fst.Path // actual user home directory

}

func MakeConfig

func MakeConfig() Config

Initialize with sensible defaults.

func (Config) Parse added in v0.1.0

func (c Config) Parse(file string) Config

type Layout

type Layout struct {
	// contains filtered or unexported fields
}

Managing the UI layout

func MakeLayout

func MakeLayout(w, h int) Layout

constructor for Layout

type Theme added in v0.1.0

type Theme struct {
	Default     tcell.Style
	DefaultEmph tcell.Style
	Selected    tcell.Style
	Highlight   tcell.Style
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL