Documentation ¶
Index ¶
- Constants
- type GutterMessage
- type InfoBuf
- func (i *InfoBuf) AddToHistory(ptype string, item string)
- func (i *InfoBuf) ClearGutter()
- func (i *InfoBuf) Close()
- func (i *InfoBuf) DonePrompt(canceled bool)
- func (i *InfoBuf) DownHistory(history []string)
- func (i *InfoBuf) Error(msg ...interface{})
- func (i *InfoBuf) GutterMessage(msg ...interface{})
- func (i *InfoBuf) LoadHistory()
- func (i *InfoBuf) Message(msg ...interface{})
- func (i *InfoBuf) Prompt(prompt string, msg string, ptype string, eventcb func(string), ...)
- func (i *InfoBuf) Reset()
- func (i *InfoBuf) SaveHistory()
- func (i *InfoBuf) UpHistory(history []string)
- func (i *InfoBuf) YNPrompt(prompt string, donecb func(bool, bool))
Constants ¶
const ( // GutterInfo represents a simple info message GutterInfo = iota // GutterWarning represents a compiler warning GutterWarning // GutterError represents a compiler error GutterError )
These are the different types of messages
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GutterMessage ¶
type GutterMessage struct {
// contains filtered or unexported fields
}
A GutterMessage is a message displayed on the side of the editor
type InfoBuf ¶
type InfoBuf struct { *buffer.Buffer HasPrompt bool HasMessage bool HasError bool HasYN bool PromptType string Msg string YNResp bool // This map stores the history for all the different kinds of uses Prompt has // It's a map of history type -> history array History map[string][]string HistoryNum int // Is the current message a message from the gutter HasGutter bool PromptCallback func(resp string, canceled bool) EventCallback func(resp string) YNCallback func(yes bool, canceled bool) }
The InfoBuf displays messages and other info at the bottom of the screen. It is respresented as a buffer and a message with a style.
func (*InfoBuf) AddToHistory ¶
AddToHistory adds a new item to the history for the prompt type `ptype`. This function is not used by micro itself. It is useful for plugins which add their own items to the history, bypassing the infobar command line.
func (*InfoBuf) ClearGutter ¶
func (i *InfoBuf) ClearGutter()
ClearGutter clears the info bar and unmarks the message
func (*InfoBuf) Close ¶
func (i *InfoBuf) Close()
Close performs any cleanup necessary when shutting down the infobuffer
func (*InfoBuf) DonePrompt ¶
DonePrompt finishes the current prompt and indicates whether or not it was canceled
func (*InfoBuf) DownHistory ¶
DownHistory fetches the next item in the history
func (*InfoBuf) Error ¶
func (i *InfoBuf) Error(msg ...interface{})
Error sends an error message to the user
func (*InfoBuf) GutterMessage ¶
func (i *InfoBuf) GutterMessage(msg ...interface{})
GutterMessage displays a message and marks it as a gutter message
func (*InfoBuf) LoadHistory ¶
func (i *InfoBuf) LoadHistory()
LoadHistory attempts to load user history from configDir/buffers/history into the history map The savehistory option must be on
func (*InfoBuf) Message ¶
func (i *InfoBuf) Message(msg ...interface{})
Message sends a message to the user
func (*InfoBuf) Prompt ¶
func (i *InfoBuf) Prompt(prompt string, msg string, ptype string, eventcb func(string), donecb func(string, bool))
Prompt starts a prompt for the user, it takes a prompt, a possibly partially filled in msg and callbacks executed when the user executes an event and when the user finishes the prompt The eventcb passes the current user response as the argument and donecb passes the user's message and a boolean indicating if the prompt was canceled
func (*InfoBuf) SaveHistory ¶
func (i *InfoBuf) SaveHistory()
SaveHistory saves the user's command history to configDir/buffers/history only if the savehistory option is on