editor

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Editor

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

Editor manages a text editor with syntax highlighting.

func New

func New(lexer chroma.Lexer, changeCB func()) (*Editor, error)

New creates a new, blank editing widge.

func NewWithContent

func NewWithContent(lexer chroma.Lexer, changeCB func(), content string) (*Editor, error)

NewWithContent creates a new editing widget, initialized to the provided content.

func (*Editor) Focus

func (e *Editor) Focus()

Focus forces the editor to take focus.

func (*Editor) GetContent

func (e *Editor) GetContent() string

GetContent returns the contents of the editor.

func (*Editor) Restyle

func (e *Editor) Restyle()

Restyle styles the editor from scratch.

func (*Editor) SetContent

func (e *Editor) SetContent(content string)

SetContent changes the contents of the editor.

func (*Editor) UI

func (e *Editor) UI() *gtk.TextView

Jump to

Keyboard shortcuts

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