Documentation ¶
Index ¶
- func DrawBuffer(screen tcell.Screen, palette *Palette, buffer *state.BufferState, ...)
- func DrawEditor(screen tcell.Screen, palette *Palette, editorState *state.EditorState, ...)
- func DrawMenu(screen tcell.Screen, palette *Palette, menu *state.MenuState)
- func DrawSearchQuery(screen tcell.Screen, palette *Palette, query string, ...)
- func DrawStatusBar(screen tcell.Screen, palette *Palette, statusMsg state.StatusMsg, ...)
- func DrawTextField(screen tcell.Screen, palette *Palette, textfield *state.TextFieldState)
- type Palette
- func (p *Palette) StyleForLineNum() tcell.Style
- func (p *Palette) StyleForMenuBorder() tcell.Style
- func (p *Palette) StyleForMenuCursor() tcell.Style
- func (p *Palette) StyleForMenuIcon() tcell.Style
- func (p *Palette) StyleForMenuItem(selected bool) tcell.Style
- func (p *Palette) StyleForMenuPrompt() tcell.Style
- func (p *Palette) StyleForMenuQuery() tcell.Style
- func (p *Palette) StyleForSearchCursor() tcell.Style
- func (p *Palette) StyleForSearchMatch() tcell.Style
- func (p *Palette) StyleForSearchPrefix() tcell.Style
- func (p *Palette) StyleForSearchQuery() tcell.Style
- func (p *Palette) StyleForSelection() tcell.Style
- func (p *Palette) StyleForStatusFilePath() tcell.Style
- func (p *Palette) StyleForStatusInputBuffer() tcell.Style
- func (p *Palette) StyleForStatusInputMode() tcell.Style
- func (p *Palette) StyleForStatusMsg(statusMsgStyle state.StatusMsgStyle) tcell.Style
- func (p *Palette) StyleForStatusRecordingMacro() tcell.Style
- func (p *Palette) StyleForTextFieldBorder() tcell.Style
- func (p *Palette) StyleForTextFieldInputText() tcell.Style
- func (p *Palette) StyleForTextFieldPrompt() tcell.Style
- func (p *Palette) StyleForTokenRole(tokenRole parser.TokenRole) tcell.Style
- type ScreenRegion
- func (r *ScreenRegion) Clear()
- func (r *ScreenRegion) Fill(c rune, style tcell.Style)
- func (r *ScreenRegion) GetContent(x, y int) (mainc rune, combc []rune, style tcell.Style)
- func (r *ScreenRegion) HideCursor()
- func (r *ScreenRegion) SetContent(x int, y int, mainc rune, combc []rune, style tcell.Style)
- func (r *ScreenRegion) SetStyleInCell(x, y int, style tcell.Style)
- func (r *ScreenRegion) ShowCursor(x, y int)
- func (r *ScreenRegion) Size() (width int, height int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DrawBuffer ¶
func DrawBuffer(screen tcell.Screen, palette *Palette, buffer *state.BufferState, inputMode state.InputMode)
DrawBuffer draws text buffer in the screen.
func DrawEditor ¶
func DrawEditor(screen tcell.Screen, palette *Palette, editorState *state.EditorState, inputBufferString string)
DrawEditor draws the editor in the screen.
func DrawSearchQuery ¶
func DrawSearchQuery(screen tcell.Screen, palette *Palette, query string, direction state.SearchDirection)
DrawSearchQuery draws the search query (if any) on the last line of the screen. This overwrites the status bar.
func DrawStatusBar ¶
func DrawStatusBar( screen tcell.Screen, palette *Palette, statusMsg state.StatusMsg, inputMode state.InputMode, inputBufferString string, isRecordingUserMacro bool, filePath string, )
DrawStatusBar draws a status bar on the last line of the screen.
func DrawTextField ¶ added in v1.3.0
func DrawTextField(screen tcell.Screen, palette *Palette, textfield *state.TextFieldState)
DrawTextField draws the text field for user input at the top of the screen.
Types ¶
type Palette ¶ added in v0.2.0
type Palette struct {
// contains filtered or unexported fields
}
Palette controls the style of displayed text.
func NewPalette ¶ added in v0.2.0
func NewPalette() *Palette
func NewPaletteFromConfigStyles ¶ added in v0.2.0
func NewPaletteFromConfigStyles(styles map[string]config.StyleConfig) *Palette
func (*Palette) StyleForLineNum ¶ added in v0.2.0
func (p *Palette) StyleForLineNum() tcell.Style
func (*Palette) StyleForMenuBorder ¶ added in v0.2.0
func (p *Palette) StyleForMenuBorder() tcell.Style
func (*Palette) StyleForMenuCursor ¶ added in v0.2.0
func (p *Palette) StyleForMenuCursor() tcell.Style
func (*Palette) StyleForMenuIcon ¶ added in v0.2.0
func (p *Palette) StyleForMenuIcon() tcell.Style
func (*Palette) StyleForMenuItem ¶ added in v0.2.0
func (*Palette) StyleForMenuPrompt ¶ added in v0.2.0
func (p *Palette) StyleForMenuPrompt() tcell.Style
func (*Palette) StyleForMenuQuery ¶ added in v0.2.0
func (p *Palette) StyleForMenuQuery() tcell.Style
func (*Palette) StyleForSearchCursor ¶ added in v1.1.0
func (p *Palette) StyleForSearchCursor() tcell.Style
func (*Palette) StyleForSearchMatch ¶ added in v0.2.0
func (p *Palette) StyleForSearchMatch() tcell.Style
func (*Palette) StyleForSearchPrefix ¶ added in v0.2.0
func (p *Palette) StyleForSearchPrefix() tcell.Style
func (*Palette) StyleForSearchQuery ¶ added in v0.2.0
func (p *Palette) StyleForSearchQuery() tcell.Style
func (*Palette) StyleForSelection ¶ added in v0.2.0
func (p *Palette) StyleForSelection() tcell.Style
func (*Palette) StyleForStatusFilePath ¶ added in v0.2.0
func (p *Palette) StyleForStatusFilePath() tcell.Style
func (*Palette) StyleForStatusInputBuffer ¶ added in v0.2.0
func (p *Palette) StyleForStatusInputBuffer() tcell.Style
func (*Palette) StyleForStatusInputMode ¶ added in v0.2.0
func (p *Palette) StyleForStatusInputMode() tcell.Style
func (*Palette) StyleForStatusMsg ¶ added in v0.2.0
func (p *Palette) StyleForStatusMsg(statusMsgStyle state.StatusMsgStyle) tcell.Style
func (*Palette) StyleForStatusRecordingMacro ¶ added in v0.3.0
func (p *Palette) StyleForStatusRecordingMacro() tcell.Style
func (*Palette) StyleForTextFieldBorder ¶ added in v1.3.0
func (p *Palette) StyleForTextFieldBorder() tcell.Style
func (*Palette) StyleForTextFieldInputText ¶ added in v1.3.0
func (p *Palette) StyleForTextFieldInputText() tcell.Style
func (*Palette) StyleForTextFieldPrompt ¶ added in v1.3.0
func (p *Palette) StyleForTextFieldPrompt() tcell.Style
func (*Palette) StyleForTokenRole ¶ added in v0.2.0
type ScreenRegion ¶
type ScreenRegion struct {
// contains filtered or unexported fields
}
ScreenRegion draws to a rectangular region in a screen.
func NewScreenRegion ¶
func NewScreenRegion(screen tcell.Screen, x, y, width, height int) *ScreenRegion
NewScreenRegion defines a new rectangular region within a screen.
func (*ScreenRegion) Clear ¶
func (r *ScreenRegion) Clear()
Clear resets a rectangular region of the screen to its initial state.
func (*ScreenRegion) Fill ¶
func (r *ScreenRegion) Fill(c rune, style tcell.Style)
Fill fills a rectangular region of the screen with a character.
func (*ScreenRegion) GetContent ¶
func (r *ScreenRegion) GetContent(x, y int) (mainc rune, combc []rune, style tcell.Style)
GetContent returns the content of a cell in the screen region. The x and y coordinates are relative to the origin of the region. If the coordinates are out of range, zero values will be returned.
func (*ScreenRegion) HideCursor ¶
func (r *ScreenRegion) HideCursor()
HideCursor prevents the cursor from being displayed.
func (*ScreenRegion) SetContent ¶
func (r *ScreenRegion) SetContent(x int, y int, mainc rune, combc []rune, style tcell.Style)
SetContent sets the content of a cell in the screen region. The x and y coordinates are relative to the origin of the region. Attempts to set content outside the region or screen are ignored.
func (*ScreenRegion) SetStyleInCell ¶ added in v1.1.0
func (r *ScreenRegion) SetStyleInCell(x, y int, style tcell.Style)
SetStyle sets the style of a cell without changing its content. Attempts to set content outside the region or screen are ignored.
func (*ScreenRegion) ShowCursor ¶
func (r *ScreenRegion) ShowCursor(x, y int)
ShowCursor sets the location of the cursor on the screen. The x and y coordinates are relative to the origin of the region. If the coodinates are outside of the screen region, the cursor will be hidden.
func (*ScreenRegion) Size ¶
func (r *ScreenRegion) Size() (width int, height int)
Size returns the width and height of the screen region.