ace

package
v0.0.0-...-c85e1c3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2017 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

func NewAdapter

func NewAdapter() *Adapter

func (*Adapter) AttachEditor

func (a *Adapter) AttachEditor(session Lengther, doc Document)

func (*Adapter) AttachFd

func (a *Adapter) AttachFd(fd int)

func (*Adapter) AttachSocket

func (a *Adapter) AttachSocket(state *ot.Controller, conn Sender)

func (*Adapter) IsSuppressed

func (a *Adapter) IsSuppressed() bool

func (*Adapter) OnChange

func (a *Adapter) OnChange(change *js.Object) bool

func (*Adapter) Recv

func (a *Adapter) Recv(ops ot.Ops)

func (*Adapter) Send

func (a *Adapter) Send(rev int, hash string, ops ot.Ops)

func (*Adapter) Suppress

func (a *Adapter) Suppress(suppress bool)

type Document

type Document interface {
	GetLines(a, b int) LineArray
	GetAllLines() LineArray
	SetOnChange(f func(ev *js.Object) bool)
	Insert(p Position, s string)
	Remove(se StartEnd)
}

type JSDocument

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

func NewJSDocument

func NewJSDocument(doc *js.Object) JSDocument

func (JSDocument) GetAllLines

func (j JSDocument) GetAllLines() LineArray

func (JSDocument) GetLines

func (j JSDocument) GetLines(a, b int) LineArray

func (JSDocument) Insert

func (j JSDocument) Insert(p Position, s string)

func (JSDocument) Remove

func (j JSDocument) Remove(se StartEnd)

func (JSDocument) SetOnChange

func (j JSDocument) SetOnChange(f func(ev *js.Object) bool)

type JSLine

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

func (JSLine) Length

func (j JSLine) Length() int

type JSLineArray

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

func (JSLineArray) Index

func (j JSLineArray) Index(i int) Line

func (JSLineArray) Length

func (j JSLineArray) Length() int

type JSPosition

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

func (JSPosition) Col

func (j JSPosition) Col() int

func (JSPosition) JS

func (j JSPosition) JS() *js.Object

func (JSPosition) Row

func (j JSPosition) Row() int

func (JSPosition) Set

func (j JSPosition) Set(row, col int)

type JSStartEnd

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

func (JSStartEnd) End

func (j JSStartEnd) End() Position

func (JSStartEnd) JS

func (j JSStartEnd) JS() *js.Object

func (JSStartEnd) Set

func (j JSStartEnd) Set(start, end Position)

func (JSStartEnd) Start

func (j JSStartEnd) Start() Position

type Lengther

type Lengther interface {
	Length() int
}

type Line

type Line interface {
	Length() int
}

type LineArray

type LineArray interface {
	Length() int
	Index(i int) Line
}

type Position

type Position interface {
	Row() int
	Col() int
	Set(row, col int)
	JS() *js.Object
}

func NewRowCol

func NewRowCol(doc Document, pos int) Position

type Range

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

func NewRange

func NewRange(doc Document, se StartEnd) *Range

func (*Range) End

func (r *Range) End() int

func (*Range) Start

func (r *Range) Start() int

type ReconnectingSocketSender

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

func NewReconnectingSocketSender

func NewReconnectingSocketSender(apiEndPoint string, onMessage func(e *js.Object), newOpenMsg func() msg.Msg) *ReconnectingSocketSender

func (*ReconnectingSocketSender) Send

func (r *ReconnectingSocketSender) Send(msg []byte)

type Sender

type Sender interface {
	Send(msg []byte)
}

type SessionLengther

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

func NewSessionLengther

func NewSessionLengther(session *js.Object) SessionLengther

func (SessionLengther) Length

func (a SessionLengther) Length() int

type SocketSender

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

func NewSocketSender

func NewSocketSender(conn *js.Object) SocketSender

func (SocketSender) Send

func (s SocketSender) Send(msg []byte)

type StartEnd

type StartEnd interface {
	Start() Position
	End() Position
	Set(start, end Position)
	JS() *js.Object
}

func NewJSStartEnd

func NewJSStartEnd(obj *js.Object) StartEnd

func NewStartEnd

func NewStartEnd(doc Document, start, end int) StartEnd

Notes

Bugs

  • end is bogus after delete when \n in text... Repro: abc\ndef<<<^H

Jump to

Keyboard shortcuts

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