editor

package
v0.0.0-...-1183947 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteWidth

func ByteWidth(str string, tabSize int) int

func Count

func Count(b []byte) int

func GetCursorVisualX

func GetCursorVisualX(x int, line string) int

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

Types

type Block

type Block struct {
	Rune  rune
	Style tcell.Style
}

type Dataview

type Dataview struct {
	*xi.LineCache
	*rpc.InputHandler
	ViewId string
}

type Editor

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

func NewEdit

func NewEdit(rw io.ReadWriter, configPath string) *Editor

func (*Editor) Init

func (e *Editor) Init()

func (*Editor) NewFooter

func (e *Editor) NewFooter() *Footer

NewView returns a new view view primitive.

func (*Editor) NewFooterTree

func (e *Editor) NewFooterTree() *FooterTree

NewView returns a new view view primitive.

func (*Editor) NewGotoLine

func (e *Editor) NewGotoLine() *GotoLine

NewView returns a new view view primitive.

func (*Editor) NewGutter

func (e *Editor) NewGutter() *Gutter

NewView returns a new view view primitive.

func (*Editor) NewHeader

func (e *Editor) NewHeader() *Header

func (*Editor) NewLinenums

func (e *Editor) NewLinenums() *Linenums

NewView returns a new view view primitive.

func (*Editor) NewOpenFile

func (e *Editor) NewOpenFile() *OpenFile

NewView returns a new view view primitive.

func (*Editor) OpenFile

func (e *Editor) OpenFile(path string) string

func (*Editor) Quit

func (e *Editor) Quit()

func (*Editor) Start

func (e *Editor) Start()

type File

type File struct {
	FilePath string
}
type Footer struct {
	*tview.Box
	*Editor
	// contains filtered or unexported fields
}

func (*Footer) Draw

func (m *Footer) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

type FooterTree

type FooterTree struct {
	*tview.Box
	*Editor
}

func (*FooterTree) Draw

func (m *FooterTree) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

type GotoLine

type GotoLine struct {
	*tview.Box
	*Editor
	// contains filtered or unexported fields
}

func (*GotoLine) Draw

func (g *GotoLine) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

func (*GotoLine) InputHandler

func (g *GotoLine) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

type Gutter

type Gutter struct {
	*tview.Box
	*Editor
	// contains filtered or unexported fields
}

func (*Gutter) Draw

func (l *Gutter) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

type Header struct {
	*tview.Box
	*Editor
	// contains filtered or unexported fields
}

func (*Header) Draw

func (m *Header) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

type Linenums

type Linenums struct {
	*tview.Box
	*Editor
	// contains filtered or unexported fields
}

func (*Linenums) Draw

func (l *Linenums) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

type OpenFile

type OpenFile struct {
	*tview.Box
	*Editor
	// contains filtered or unexported fields
}

func (*OpenFile) Draw

func (g *OpenFile) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

func (*OpenFile) InputHandler

func (g *OpenFile) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

type View

type View struct {
	Lines [][]Block
	*tview.Box
	*Editor
	// contains filtered or unexported fields
}

View implements the view editor view.

func NewView

func NewView() *View

NewView returns a new view view primitive.

func (*View) Draw

func (v *View) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

func (*View) InputHandler

func (v *View) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns the handler for this primitive.

func (*View) MakeVisible

func (v *View) MakeVisible(x, y int)

Jump to

Keyboard shortcuts

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