carrera

package module
v0.0.0-...-e70363e Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2018 License: MIT Imports: 3 Imported by: 0

README

carrera

CUI code editor WIP code.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &Config{
	TabWidth: 2,
}

Functions

func SetCell

func SetCell(x, y int, c Cell)

Types

type Buffer

type Buffer []rune

func NewBuffer

func NewBuffer() Buffer

func NewBufferWithCapacity

func NewBufferWithCapacity(c int) Buffer

type BufferPresenter

type BufferPresenter interface {
	Area(line, width, height int) [][]Cell
	Insert(pos int, r rune)
	Delete(pos int) rune
}

type BufferService

type BufferService interface {
	Cell(pos int) Cell
	Insert(pos int, r rune)
	Delete(pos int) rune
	Set(rs []rune)
	Clear()
	Length() int
}

type BufferView

type BufferView interface {
	Draw()
	Handle(event Event)
}

type Cell

type Cell struct {
	Ch rune
	Fg Color
	Bg Color
}

type Color

type Color termbox.Attribute

type Config

type Config struct {
	TabWidth int
}

type Event

type Event termbox.Event

type Style

type Style struct {
	Color  Color
	Tokens []chroma.TokenType
}

func NewStyle

func NewStyle(color Color, tokens ...chroma.TokenType) Style

func (Style) Match

func (s Style) Match(tokenType chroma.TokenType) bool

type StyleArray

type StyleArray []Style

func (StyleArray) Color

func (s StyleArray) Color(tokenType chroma.TokenType) Color

type Syntax

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

func NewSyntax

func NewSyntax(lexer chroma.Lexer) Syntax

func NewSyntaxWithStyles

func NewSyntaxWithStyles(lexer chroma.Lexer, styles []Style) Syntax

func (Syntax) Highlight

func (s Syntax) Highlight(rs []rune) []Cell

Directories

Path Synopsis
bin

Jump to

Keyboard shortcuts

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