Documentation
¶
Index ¶
- Constants
- type Annotation
- type Buffer
- func (buffer *Buffer) BottomMargin() uint
- func (buffer *Buffer) ClearHighlight()
- func (buffer *Buffer) ClearSelection()
- func (buffer *Buffer) CursorColumn() uint16
- func (buffer *Buffer) CursorLine() uint16
- func (buffer *Buffer) CursorLineAbsolute() uint16
- func (buffer *Buffer) ExtendSelectionToEntireLines()
- func (buffer *Buffer) FindWordAt(pos Position, runeMatcher RuneMatcher) (start Position, end Position, text string, textIndex int, found bool)
- func (buffer *Buffer) GetBoundedTextAtPosition(pos Position) (start Position, end Position, text string, textIndex int, found bool)
- func (buffer *Buffer) GetCell(viewCol uint16, viewRow uint16) *Cell
- func (buffer *Buffer) GetCurrentLine() *Line
- func (buffer *Buffer) GetHighlightAnnotation() *Annotation
- func (buffer *Buffer) GetMaxLines() uint64
- func (buffer *Buffer) GetScrollOffset() uint
- func (buffer *Buffer) GetSelection() (string, *Selection)
- func (buffer *Buffer) GetVPosition() int
- func (buffer *Buffer) GetViewHighlight() (start Position, end Position, exists bool)
- func (buffer *Buffer) GetVisibleLines() []Line
- func (b *Buffer) GetVisibleSixels() []VisibleSixel
- func (buffer *Buffer) HasScrollableRegion() bool
- func (buffer *Buffer) Height() int
- func (buffer *Buffer) Highlight(start Position, end Position, annotation *Annotation)
- func (buffer *Buffer) InScrollableRegion() bool
- func (buffer *Buffer) InSelection(pos Position) bool
- func (buffer *Buffer) IsApplicationCursorKeysModeEnabled() bool
- func (buffer *Buffer) IsCursorVisible() bool
- func (buffer *Buffer) IsNewLineMode() bool
- func (buffer *Buffer) IsTabSetAtCursor() bool
- func (buffer *Buffer) RawLine() uint64
- func (buffer *Buffer) ScrollDown(lines uint)
- func (buffer *Buffer) ScrollToEnd()
- func (buffer *Buffer) ScrollUp(lines uint)
- func (buffer *Buffer) SelectWordAt(pos Position, runeMatcher RuneMatcher)
- func (buffer *Buffer) SetScrollOffset(offset uint)
- func (buffer *Buffer) SetSelectionEnd(pos Position)
- func (buffer *Buffer) SetSelectionStart(pos Position)
- func (buffer *Buffer) TopMargin() uint
- func (buffer *Buffer) ViewHeight() uint16
- func (buffer *Buffer) ViewWidth() uint16
- func (buffer *Buffer) Width() uint16
- type Cell
- func (cell *Cell) Attr() CellAttributes
- func (cell *Cell) Bg() color.Color
- func (cell *Cell) Bold() bool
- func (cell *Cell) Dim() bool
- func (cell *Cell) Fg() color.Color
- func (cell *Cell) Italic() bool
- func (cell *Cell) Rune() MeasuredRune
- func (cell *Cell) Strikethrough() bool
- func (cell *Cell) Underline() bool
- type CellAttributes
- type Colour
- type Line
- type MeasuredRune
- type Modes
- type MouseExtMode
- type MouseMode
- type Option
- type Position
- type Reader
- type RuneMatcher
- type Selection
- type Sixel
- type Terminal
- type Theme
- func (t *Theme) ColourFrom24Bit(r, g, b string) (color.Color, error)
- func (t *Theme) ColourFrom4Bit(code uint8) color.Color
- func (t *Theme) ColourFrom8Bit(n string) (color.Color, error)
- func (t *Theme) ColourFromAnsi(ansi []string, bg bool) (color.Color, error)
- func (t *Theme) CursorBackground() color.Color
- func (t *Theme) CursorForeground() color.Color
- func (t *Theme) DefaultBackground() color.Color
- func (t *Theme) DefaultForeground() color.Color
- func (t *Theme) SelectionBackground() color.Color
- func (t *Theme) SelectionForeground() color.Color
- type ThemeFactory
- type VisibleSixel
- type WindowManipulator
- type WindowState
Constants ¶
View Source
const ( MouseModeNone MouseMode = iota MouseModeX10 MouseModeVT200 MouseModeVT200Highlight MouseModeButtonEvent MouseModeAnyEvent MouseExtNone MouseExtMode = iota MouseExtUTF MouseExtSGR MouseExtURXVT )
View Source
const ( MainBuffer uint8 = 0 AltBuffer uint8 = 1 InternalBuffer uint8 = 2 )
View Source
const TabSize = 8
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
func (*Buffer) BottomMargin ¶
func (*Buffer) ClearHighlight ¶
func (buffer *Buffer) ClearHighlight()
func (*Buffer) ClearSelection ¶
func (buffer *Buffer) ClearSelection()
func (*Buffer) CursorColumn ¶
Column returns cursor column
func (*Buffer) CursorLine ¶
CursorLine returns cursor line (in Origin Mode it is relative to the top margin)
func (*Buffer) CursorLineAbsolute ¶
CursorLineAbsolute returns absolute cursor line coordinate (ignoring Origin Mode) - view format
func (*Buffer) ExtendSelectionToEntireLines ¶
func (buffer *Buffer) ExtendSelectionToEntireLines()
func (*Buffer) FindWordAt ¶
func (buffer *Buffer) FindWordAt(pos Position, runeMatcher RuneMatcher) (start Position, end Position, text string, textIndex int, found bool)
returns raw lines
func (*Buffer) GetBoundedTextAtPosition ¶
func (*Buffer) GetHighlightAnnotation ¶
func (buffer *Buffer) GetHighlightAnnotation() *Annotation
func (*Buffer) GetMaxLines ¶
func (*Buffer) GetScrollOffset ¶
func (*Buffer) GetSelection ¶
func (*Buffer) GetVPosition ¶
func (*Buffer) GetViewHighlight ¶
func (*Buffer) GetVisibleLines ¶
func (*Buffer) GetVisibleSixels ¶
func (b *Buffer) GetVisibleSixels() []VisibleSixel
func (*Buffer) HasScrollableRegion ¶
func (*Buffer) Highlight ¶
func (buffer *Buffer) Highlight(start Position, end Position, annotation *Annotation)
takes raw coords
func (*Buffer) InScrollableRegion ¶
func (*Buffer) InSelection ¶
func (*Buffer) IsApplicationCursorKeysModeEnabled ¶
func (*Buffer) IsCursorVisible ¶
func (*Buffer) IsNewLineMode ¶
func (*Buffer) IsTabSetAtCursor ¶
func (*Buffer) ScrollDown ¶
func (*Buffer) ScrollToEnd ¶
func (buffer *Buffer) ScrollToEnd()
func (*Buffer) SelectWordAt ¶
func (buffer *Buffer) SelectWordAt(pos Position, runeMatcher RuneMatcher)
func (*Buffer) SetScrollOffset ¶
func (*Buffer) SetSelectionEnd ¶
func (*Buffer) SetSelectionStart ¶
func (*Buffer) ViewHeight ¶
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
func (*Cell) Attr ¶
func (cell *Cell) Attr() CellAttributes
func (*Cell) Rune ¶
func (cell *Cell) Rune() MeasuredRune
func (*Cell) Strikethrough ¶
type CellAttributes ¶
type CellAttributes struct {
// contains filtered or unexported fields
}
type Colour ¶
type Colour uint8
const ( ColourBlack Colour = iota ColourRed ColourGreen ColourYellow ColourBlue ColourMagenta ColourCyan ColourWhite ColourBrightBlack ColourBrightRed ColourBrightGreen ColourBrightYellow ColourBrightBlue ColourBrightMagenta ColourBrightCyan ColourBrightWhite ColourBackground ColourForeground ColourSelectionBackground ColourSelectionForeground ColourCursorForeground ColourCursorBackground )
See https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit
type MeasuredRune ¶
func (MeasuredRune) Empty ¶
func (m MeasuredRune) Empty() bool
type Modes ¶
type Modes struct { ShowCursor bool ApplicationCursorKeys bool BlinkingCursor bool ReplaceMode bool // overwrite character at cursor or insert new OriginMode bool // see DECOM docs - whether cursor is positioned within the margins or not LineFeedMode bool ScreenMode bool // DECSCNM (black on white background) AutoWrap bool SixelScrolling bool // DECSDM BracketedPasteMode bool }
type MouseExtMode ¶
type MouseExtMode uint
type Option ¶
type Option func(t *Terminal)
func WithLogFile ¶
func WithRequestRender ¶
func WithRequestRender(f func()) Option
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func (*Reader) ReadRune ¶
func (reader *Reader) ReadRune() MeasuredRune
type RuneMatcher ¶
type Terminal ¶
type Terminal struct { RequestRender func() // contains filtered or unexported fields }
Terminal communicates with the underlying terminal
func (*Terminal) GetActiveBuffer ¶
func (*Terminal) GetMouseExtMode ¶
func (t *Terminal) GetMouseExtMode() MouseExtMode
func (*Terminal) GetMouseMode ¶
type Theme ¶
type Theme struct {
// contains filtered or unexported fields
}
func (*Theme) ColourFrom24Bit ¶
func (*Theme) ColourFromAnsi ¶
func (*Theme) CursorBackground ¶
func (*Theme) CursorForeground ¶
func (*Theme) DefaultBackground ¶
func (*Theme) DefaultForeground ¶
func (*Theme) SelectionBackground ¶
func (*Theme) SelectionForeground ¶
type ThemeFactory ¶
type ThemeFactory struct {
// contains filtered or unexported fields
}
func NewThemeFactory ¶
func NewThemeFactory() *ThemeFactory
func (*ThemeFactory) Build ¶
func (t *ThemeFactory) Build() *Theme
func (*ThemeFactory) WithColour ¶
func (t *ThemeFactory) WithColour(key Colour, colour color.Color) *ThemeFactory
type VisibleSixel ¶
type WindowManipulator ¶
type WindowManipulator interface { State() WindowState Minimise() Maximise() Restore() SetTitle(title string) Position() (int, int) SizeInPixels() (int, int) CellSizeInPixels() (int, int) SizeInChars() (int, int) ResizeInPixels(int, int) ResizeInChars(int, int) ScreenSizeInPixels() (int, int) ScreenSizeInChars() (int, int) Move(x, y int) IsFullscreen() bool SetFullscreen(enabled bool) GetTitle() string SaveTitleToStack() RestoreTitleFromStack() ReportError(err error) }
type WindowState ¶
type WindowState uint8
const ( StateUnknown WindowState = iota StateMinimised StateNormal StateMaximised )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.