Documentation ¶
Index ¶
- Variables
- func DrawChan() chan bool
- func Init() error
- func InitSimScreen() (tcell.SimulationScreen, error)
- func Lock()
- func Redraw()
- func SetContent(x, y int, mainc rune, combc []rune, style tcell.Style)
- func ShowCursor(x, y int)
- func ShowFakeCursor(x, y int)
- func ShowFakeCursorMulti(x, y int)
- func TempFini() bool
- func TempStart(screenWasNil bool)
- func TermError(filename string, lineNum int, err string)
- func TermMessage(msg ...interface{})
- func TermPrompt(prompt string, options []string, wait bool) int
- func Unlock()
- func UseFake() bool
Constants ¶
This section is empty.
Variables ¶
var Events chan (tcell.Event)
Events is the channel of tcell events
var RestartCallback func()
RestartCallback is called when the screen is restarted after it was temporarily shut down
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 InitSimScreen ¶ added in v2.0.6
func InitSimScreen() (tcell.SimulationScreen, error)
InitSimScreen initializes a simulation screen for testing purposes
func SetContent ¶
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 TempStart ¶
func TempStart(screenWasNil bool)
TempStart restarts the screen after it was temporarily disabled
func TermError ¶
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 ¶
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
Types ¶
This section is empty.