editor

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: BSD-3-Clause Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Editor

type Editor struct {
	KeyBindings map[*keyViewPair]*KeyBinding
	State       *editorState
	// contains filtered or unexported fields
}

Editor is the hunk editor UI

func NewEditor

func NewEditor(file *diffparser.DiffFile) (*Editor, error)

NewEditor initializes the editor, pre-checks made here

func (*Editor) Run

func (e *Editor) Run() ([]string, error)

Run starts the editor

type KeyBinding

type KeyBinding struct {
	View        string
	Handler     func(*gocui.Gui, *gocui.View) error
	Key         interface{}
	Modifier    gocui.Modifier
	Display     string
	Description string
}

KeyBinding structs is helpful for not re-writinh the same function over and over again. it hold useful values to generate a controls view

type View

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

View is a name-header pair for creating *gocui.View structs

func (*View) String

func (v *View) String() string

Jump to

Keyboard shortcuts

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