Documentation ¶
Index ¶
- Constants
- Variables
- func EncodedInt(n int) []byte
- type Attr
- type Cell
- type CellAttrs
- type Color
- type Mode
- type Op
- type Screen
- type ScrollRegion
- type StreamBuffer
- func (s *StreamBuffer) WriteColor(c Color) (int, error)
- func (s *StreamBuffer) WriteEncodedInt(n int) (int, error)
- func (s *StreamBuffer) WriteEncodedInts(run ...int) (n int, err error)
- func (s *StreamBuffer) WriteOp(op Op) error
- func (s *StreamBuffer) WriteRuneRun(str []rune) (n int, err error)
- func (s *StreamBuffer) WriteStringRun(str string) (n int, err error)
- type Vector2
Constants ¶
const ( ColorForeground uint8 = iota ColorBackground ColorSpecial )
const RGBMask = 1 << 31
Variables ¶
var JSConst []byte
JSConst will contain a javascript representation of the constants above.
Functions ¶
func EncodedInt ¶
EncodedInt creates 1-5 bytes representing a 32 bit integer depending on the value. This allows for integers to be sent using only the bytes necessary to represent their values, instead of using a fixed byte size. Each byte contributes 7 bits, with the high bit (0x80) used to indicate that the next byte contributes to the value.
Types ¶
type Color ¶
type Color int32
Color can represent a 24 bit RGB color or indexed color.
func ColorFromBytes ¶
type Screen ¶
type Screen struct { Size Vector2 // Screen size. Cursor Vector2 // Cursor postion. Title string // Current mode. Mode Mode // Mouse state. This updates Mode. Mouse bool // Busy state. This updates Mode. Busy bool // Default attributes for updating attributes. DefaultAttrs *CellAttrs // Current attributes for new characters. CurAttrs *CellAttrs // The rendered screen. Buffer []Cell // contains filtered or unexported fields }
func (*Screen) RedrawHandler ¶
func (s *Screen) RedrawHandler(updates ...[]interface{})
RedrawHandler deals with the msgpack input from Neovim
type ScrollRegion ¶
type ScrollRegion struct {
// contains filtered or unexported fields
}
type StreamBuffer ¶
StreamBuffer is the same as bytes.Buffer with a few additions.
func (*StreamBuffer) WriteColor ¶
func (s *StreamBuffer) WriteColor(c Color) (int, error)
func (*StreamBuffer) WriteEncodedInt ¶
func (s *StreamBuffer) WriteEncodedInt(n int) (int, error)
func (*StreamBuffer) WriteEncodedInts ¶
func (s *StreamBuffer) WriteEncodedInts(run ...int) (n int, err error)
func (*StreamBuffer) WriteOp ¶
func (s *StreamBuffer) WriteOp(op Op) error
func (*StreamBuffer) WriteRuneRun ¶
func (s *StreamBuffer) WriteRuneRun(str []rune) (n int, err error)
WriteRuneRun writes a run of runes by prefixing the bytes with a length.
func (*StreamBuffer) WriteStringRun ¶
func (s *StreamBuffer) WriteStringRun(str string) (n int, err error)
WriteStringRun is a convenience for WriteRuneRun.