screen

package
v2.0.13 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Events chan (tcell.Event)

Events is the channel of tcell events

View Source
var Screen tcell.Screen

Screen is the tcell screen we use to draw to the terminal Synchronization is used because we poll the screen on a separate thread and sometimes the screen is shut down by the main thread (for example on TermMessage) so we don't want to poll a nil/shutdown screen. TODO: maybe we should worry about polling and drawing at the same time too.

Functions

func DrawChan

func DrawChan() chan bool

DrawChan returns the draw channel

func Init

func Init() error

Init creates and initializes the tcell screen

func InitSimScreen added in v2.0.6

func InitSimScreen() (tcell.SimulationScreen, error)

InitSimScreen initializes a simulation screen for testing purposes

func Lock

func Lock()

Lock locks the screen lock

func Redraw

func Redraw()

Redraw schedules a redraw with the draw channel

func SetContent

func SetContent(x, y int, mainc rune, combc []rune, style tcell.Style)

SetContent sets a cell at a point on the screen and makes sure that it is synced with the last cursor location

func ShowCursor

func ShowCursor(x, y int)

ShowCursor puts the cursor at the given location using a fake cursor if enabled or using the terminal cursor otherwise By default only the windows console will use a fake cursor

func ShowFakeCursor

func ShowFakeCursor(x, y int)

ShowFakeCursor displays a cursor at the given position by modifying the style of the given column instead of actually using the terminal cursor This can be useful in certain terminals such as the windows console where modifying the cursor location is slow and frequent modifications cause flashing This keeps track of the most recent fake cursor location and resets it when a new fake cursor location is specified

func ShowFakeCursorMulti

func ShowFakeCursorMulti(x, y int)

ShowFakeCursorMulti is the same as ShowFakeCursor except it does not reset previous locations of the cursor Fake cursors are also necessary to display multiple cursors

func TempFini

func TempFini() bool

TempFini shuts the screen down temporarily

func TempStart

func TempStart(screenWasNil bool)

TempStart restarts the screen after it was temporarily disabled

func TermError

func TermError(filename string, lineNum int, err string)

TermError sends an error to the user in the terminal. Like TermMessage except formatted as an error

func TermMessage

func TermMessage(msg ...interface{})

TermMessage sends a message to the user in the terminal. This usually occurs before micro has been fully initialized -- ie if there is an error in the syntax highlighting regular expressions The function must be called when the Screen is not initialized This will write the message, and wait for the user to press and key to continue

func TermPrompt

func TermPrompt(prompt string, options []string, wait bool) int

TermPrompt prints a prompt and requests the user for a response The result is matched against a list of options and the index of the match is returned If wait is true, the prompt re-prompts until a valid option is chosen, otherwise if wait is false, -1 is returned for no match

func Unlock

func Unlock()

Unlock unlocks the screen lock

func UseFake added in v2.0.12

func UseFake() bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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