micro: github.com/zyedidia/micro/internal/screen Index | Files

package screen

import "github.com/zyedidia/micro/internal/screen"

Index

Package Files

message.go screen.go

Variables

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.

func DrawChan Uses

func DrawChan() chan bool

DrawChan returns the draw channel

func Init Uses

func Init()

Init creates and initializes the tcell screen

func Lock Uses

func Lock()

Lock locks the screen lock

func Redraw Uses

func Redraw()

Redraw schedules a redraw with the draw channel

func SetContent Uses

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 Uses

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 Uses

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 Uses

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 Uses

func TempFini() bool

TempFini shuts the screen down temporarily

func TempStart Uses

func TempStart(screenWasNil bool)

TempStart restarts the screen after it was temporarily disabled

func TermError Uses

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 Uses

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 Uses

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 Uses

func Unlock()

Unlock unlocks the screen lock

Package screen imports 9 packages (graph) and is imported by 5 packages. Updated 2020-02-19. Refresh now. Tools for package owners.