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

package action

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

Index

Package Files

actions.go actions_posix.go bindings.go bufpane.go command.go defaults_other.go events.go globals.go infocomplete.go infopane.go pane.go rawpane.go tab.go terminal_supported.go termpane.go

Constants

const TermEmuSupported = true

TermEmuSupported is a constant that marks if the terminal emulator is supported

Variables

var BufKeyActions = map[string]BufKeyAction{ /* 106 elements not displayed */

}

BufKeyActions contains the list of all possible key actions the bufhandler could execute

var BufKeyBindings map[Event]BufKeyAction
var BufKeyStrings map[Event]string
var BufMouseActions = map[string]BufMouseAction{
    "MousePress":       (*BufPane).MousePress,
    "MouseMultiCursor": (*BufPane).MouseMultiCursor,
}

BufMouseActions contains the list of all possible mouse actions the bufhandler could execute

var BufMouseBindings map[MouseEvent]BufMouseAction
var InfoNones = []string{
    "Save",
    "SaveAll",
    "SaveAs",
    "Find",
    "FindNext",
    "FindPrevious",
    "Center",
    "DuplicateLine",
    "MoveLinesUp",
    "MoveLinesDown",
    "OpenFile",
    "Start",
    "End",
    "PageUp",
    "PageDown",
    "SelectPageUp",
    "SelectPageDown",
    "HalfPageUp",
    "HalfPageDown",
    "ToggleHelp",
    "ToggleKeyMenu",
    "ToggleDiffGutter",
    "ToggleRuler",
    "JumpLine",
    "ClearStatus",
    "ShellMode",
    "CommandMode",
    "AddTab",
    "PreviousTab",
    "NextTab",
    "NextSplit",
    "PreviousSplit",
    "Unsplit",
    "VSplit",
    "HSplit",
    "ToggleMacro",
    "PlayMacro",
    "Suspend",
    "ScrollUp",
    "ScrollDown",
    "SpawnMultiCursor",
    "SpawnMultiCursorSelect",
    "RemoveMultiCursor",
    "RemoveAllMultiCursors",
    "SkipMultiCursor",
}

InfoNones is a list of actions that should have no effect when executed by an infohandler

var InfoOverrides = map[string]InfoKeyAction{
    "CursorUp":      (*InfoPane).CursorUp,
    "CursorDown":    (*InfoPane).CursorDown,
    "InsertNewline": (*InfoPane).InsertNewline,
    "Autocomplete":  (*InfoPane).Autocomplete,
    "Escape":        (*InfoPane).Escape,
    "Quit":          (*InfoPane).Quit,
    "QuitAll":       (*InfoPane).QuitAll,
}

InfoOverrides is the list of actions which have been overridden by the infohandler

var MultiActions = map[string]bool{
    "CursorUp":                  true,
    "CursorDown":                true,
    "CursorPageUp":              true,
    "CursorPageDown":            true,
    "CursorLeft":                true,
    "CursorRight":               true,
    "CursorStart":               true,
    "CursorEnd":                 true,
    "SelectToStart":             true,
    "SelectToEnd":               true,
    "SelectUp":                  true,
    "SelectDown":                true,
    "SelectLeft":                true,
    "SelectRight":               true,
    "WordRight":                 true,
    "WordLeft":                  true,
    "SelectWordRight":           true,
    "SelectWordLeft":            true,
    "DeleteWordRight":           true,
    "DeleteWordLeft":            true,
    "SelectLine":                true,
    "SelectToStartOfLine":       true,
    "SelectToStartOfText":       true,
    "SelectToStartOfTextToggle": true,
    "SelectToEndOfLine":         true,
    "ParagraphPrevious":         true,
    "ParagraphNext":             true,
    "InsertNewline":             true,
    "Backspace":                 true,
    "Delete":                    true,
    "InsertTab":                 true,
    "FindNext":                  true,
    "FindPrevious":              true,
    "CopyLine":                  true,
    "Cut":                       true,
    "CutLine":                   true,
    "DuplicateLine":             true,
    "DeleteLine":                true,
    "MoveLinesUp":               true,
    "MoveLinesDown":             true,
    "IndentSelection":           true,
    "OutdentSelection":          true,
    "OutdentLine":               true,
    "IndentLine":                true,
    "Paste":                     true,
    "PastePrimary":              true,
    "SelectPageUp":              true,
    "SelectPageDown":            true,
    "StartOfLine":               true,
    "StartOfText":               true,
    "StartOfTextToggle":         true,
    "EndOfLine":                 true,
    "JumpToMatchingBrace":       true,
}

MultiActions is a list of actions that should be executed multiple times if there are multiple cursors (one per cursor) Generally actions that modify global editor state like quitting or saving should not be included in this list

var PluginCmds = []string{"install", "remove", "update", "available", "list", "search"}

func BindKey Uses

func BindKey(k, v string)

func BufMapKey Uses

func BufMapKey(k Event, action string)

BufMapKey maps a key event to an action

func BufMapMouse Uses

func BufMapMouse(k MouseEvent, action string)

BufMapMouse maps a mouse event to an action

func BufUnmap Uses

func BufUnmap(k Event)

BufUnmap unmaps a key or mouse event from any action

func CommandComplete Uses

func CommandComplete(b *buffer.Buffer) ([]string, []string)

CommandComplete autocompletes commands

func DefaultBindings Uses

func DefaultBindings() map[string]string

DefaultBindings returns a map containing micro's default keybindings

func HelpComplete Uses

func HelpComplete(b *buffer.Buffer) ([]string, []string)

HelpComplete autocompletes help topics

func InitBindings Uses

func InitBindings()

InitBindings intializes the bindings map by reading from bindings.json

func InitCommands Uses

func InitCommands()

func InitGlobals Uses

func InitGlobals()

InitGlobals initializes the log buffer and the info bar

func InitTabs Uses

func InitTabs(bufs []*buffer.Buffer)

func LuaAction Uses

func LuaAction(fn string) func(*BufPane) bool

func MakeCommand Uses

func MakeCommand(name string, action func(bp *BufPane, args []string), completer buffer.Completer)

MakeCommand is a function to easily create new commands This can be called by plugins in Lua so that plugins can define their own commands

func OptionComplete Uses

func OptionComplete(b *buffer.Buffer) ([]string, []string)

OptionComplete autocompletes options

func OptionValueComplete Uses

func OptionValueComplete(b *buffer.Buffer) ([]string, []string)

OptionValueComplete completes values for various options

func PluginCmdComplete Uses

func PluginCmdComplete(b *buffer.Buffer) ([]string, []string)

PluginCmdComplete autocompletes the plugin command

func PluginComplete Uses

func PluginComplete(b *buffer.Buffer) ([]string, []string)

PluginComplete completes values for the plugin command

func ReloadConfig Uses

func ReloadConfig()

func RunTermEmulator Uses

func RunTermEmulator(h *BufPane, input string, wait bool, getOutput bool, callback func(out string, userargs []interface{}), userargs []interface{}) error

RunTermEmulator starts a terminal emulator from a bufpane with the given input (command) if wait is true it will wait for the user to exit by pressing enter once the executable has terminated if getOutput is true it will redirect the stdout of the process to a pipe which will be passed to the callback which is a function that takes a string and a list of optional user arguments

func SetGlobalOption Uses

func SetGlobalOption(option, value string) error

func SetGlobalOptionNative Uses

func SetGlobalOptionNative(option string, nativeValue interface{}) error

func TryBindKey Uses

func TryBindKey(k, v string, overwrite bool) (bool, error)

TryBindKey tries to bind a key by writing to config.ConfigDir/bindings.json Returns true if the keybinding already existed and a possible error

func UnbindKey Uses

func UnbindKey(k string) error

UnbindKey removes the binding for a key from the bindings.json file

func WriteLog Uses

func WriteLog(s string)

WriteLog writes a string to the log buffer

type BufKeyAction Uses

type BufKeyAction func(*BufPane) bool

func CommandAction Uses

func CommandAction(cmd string) BufKeyAction

CommandAction returns a bindable function which executes the given command

func CommandEditAction Uses

func CommandEditAction(prompt string) BufKeyAction

CommandEditAction returns a bindable function that opens a prompt with the given string and executes the command when the user presses enter

type BufMouseAction Uses

type BufMouseAction func(*BufPane, *tcell.EventMouse) bool

type BufPane Uses

type BufPane struct {
    display.BWindow

    Buf *buffer.Buffer

    Cursor *buffer.Cursor // the active cursor
    // contains filtered or unexported fields
}

The BufPane connects the buffer and the window It provides a cursor (or multiple) and defines a set of actions that can be taken on the buffer The ActionHandler can access the window for necessary info about visual positions for mouse clicks and scrolling

var LogBufPane *BufPane

func NewBufPane Uses

func NewBufPane(buf *buffer.Buffer, win display.BWindow, tab *Tab) *BufPane

func NewBufPaneFromBuf Uses

func NewBufPaneFromBuf(buf *buffer.Buffer, tab *Tab) *BufPane

func (*BufPane) AddTab Uses

func (h *BufPane) AddTab() bool

AddTab adds a new tab with an empty buffer

func (*BufPane) Autocomplete Uses

func (h *BufPane) Autocomplete() bool

Autocomplete cycles the suggestions and performs autocompletion if there are suggestions

func (*BufPane) Backspace Uses

func (h *BufPane) Backspace() bool

Backspace deletes the previous character

func (*BufPane) BindCmd Uses

func (h *BufPane) BindCmd(args []string)

BindCmd creates a new keybinding

func (*BufPane) CdCmd Uses

func (h *BufPane) CdCmd(args []string)

CdCmd changes the current working directory

func (*BufPane) Center Uses

func (h *BufPane) Center() bool

Center centers the view on the cursor

func (*BufPane) ClearStatus Uses

func (h *BufPane) ClearStatus() bool

ClearStatus clears the messenger bar

func (*BufPane) Close Uses

func (h *BufPane) Close()

func (*BufPane) CommandMode Uses

func (h *BufPane) CommandMode() bool

CommandMode lets the user enter a command

func (*BufPane) Copy Uses

func (h *BufPane) Copy() bool

Copy the selection to the system clipboard

func (*BufPane) CopyLine Uses

func (h *BufPane) CopyLine() bool

Copy the current line to the clipboard

func (*BufPane) CursorDown Uses

func (h *BufPane) CursorDown() bool

CursorDown moves the cursor down

func (*BufPane) CursorEnd Uses

func (h *BufPane) CursorEnd() bool

CursorEnd moves the cursor to the end of the buffer

func (*BufPane) CursorLeft Uses

func (h *BufPane) CursorLeft() bool

CursorLeft moves the cursor left

func (*BufPane) CursorPageDown Uses

func (h *BufPane) CursorPageDown() bool

CursorPageDown places the cursor a page up

func (*BufPane) CursorPageUp Uses

func (h *BufPane) CursorPageUp() bool

CursorPageUp places the cursor a page up

func (*BufPane) CursorRight Uses

func (h *BufPane) CursorRight() bool

CursorRight moves the cursor right

func (*BufPane) CursorStart Uses

func (h *BufPane) CursorStart() bool

CursorStart moves the cursor to the start of the buffer

func (*BufPane) CursorUp Uses

func (h *BufPane) CursorUp() bool

CursorUp moves the cursor up

func (*BufPane) Cut Uses

func (h *BufPane) Cut() bool

Cut the selection to the system clipboard

func (*BufPane) CutLine Uses

func (h *BufPane) CutLine() bool

CutLine cuts the current line to the clipboard

func (*BufPane) CycleAutocompleteBack Uses

func (h *BufPane) CycleAutocompleteBack() bool

CycleAutocompleteBack cycles back in the autocomplete suggestion list

func (*BufPane) Delete Uses

func (h *BufPane) Delete() bool

Delete deletes the next character

func (*BufPane) DeleteLine Uses

func (h *BufPane) DeleteLine() bool

DeleteLine deletes the current line

func (*BufPane) DeleteWordLeft Uses

func (h *BufPane) DeleteWordLeft() bool

DeleteWordLeft deletes the word to the left of the cursor

func (*BufPane) DeleteWordRight Uses

func (h *BufPane) DeleteWordRight() bool

DeleteWordRight deletes the word to the right of the cursor

func (*BufPane) DoKeyEvent Uses

func (h *BufPane) DoKeyEvent(e Event) bool

DoKeyEvent executes a key event by finding the action it is bound to and executing it (possibly multiple times for multiple cursors)

func (*BufPane) DoMouseEvent Uses

func (h *BufPane) DoMouseEvent(e MouseEvent, te *tcell.EventMouse) bool

DoMouseEvent executes a mouse event by finding the action it is bound to and executing it

func (*BufPane) DoRuneInsert Uses

func (h *BufPane) DoRuneInsert(r rune)

DoRuneInsert inserts a given rune into the current buffer (possibly multiple times for multiple cursors)

func (*BufPane) DuplicateLine Uses

func (h *BufPane) DuplicateLine() bool

DuplicateLine duplicates the current line or selection

func (*BufPane) End Uses

func (h *BufPane) End() bool

End moves the viewport to the end of the buffer

func (*BufPane) EndOfLine Uses

func (h *BufPane) EndOfLine() bool

EndOfLine moves the cursor to the end of the line

func (*BufPane) Escape Uses

func (h *BufPane) Escape() bool

Escape leaves current mode

func (*BufPane) EvalCmd Uses

func (h *BufPane) EvalCmd(args []string)

EvalCmd evaluates a lua expression

func (*BufPane) Find Uses

func (h *BufPane) Find() bool

Find opens a prompt and searches forward for the input

func (*BufPane) FindLiteral Uses

func (h *BufPane) FindLiteral() bool

FindLiteral is the same as Find() but does not support regular expressions

func (*BufPane) FindNext Uses

func (h *BufPane) FindNext() bool

FindNext searches forwards for the last used search term

func (*BufPane) FindPrevious Uses

func (h *BufPane) FindPrevious() bool

FindPrevious searches backwards for the last used search term

func (*BufPane) GotoCmd Uses

func (h *BufPane) GotoCmd(args []string)

GotoCmd is a command that will send the cursor to a certain position in the buffer For example: `goto line`, or `goto line:col`

func (*BufPane) HSplitAction Uses

func (h *BufPane) HSplitAction() bool

HSplitAction opens an empty horizontal split

func (*BufPane) HSplitBuf Uses

func (h *BufPane) HSplitBuf(buf *buffer.Buffer) *BufPane

func (*BufPane) HSplitCmd Uses

func (h *BufPane) HSplitCmd(args []string)

HSplitCmd opens a horizontal split with file given in the first argument If no file is given, it opens an empty buffer in a new split

func (*BufPane) HSplitIndex Uses

func (h *BufPane) HSplitIndex(buf *buffer.Buffer, bottom bool) *BufPane

func (*BufPane) HalfPageDown Uses

func (h *BufPane) HalfPageDown() bool

HalfPageDown scrolls the view down half a page

func (*BufPane) HalfPageUp Uses

func (h *BufPane) HalfPageUp() bool

HalfPageUp scrolls the view up half a page

func (*BufPane) HandleCommand Uses

func (h *BufPane) HandleCommand(input string)

HandleCommand handles input from the user

func (*BufPane) HandleEvent Uses

func (h *BufPane) HandleEvent(event tcell.Event)

HandleEvent executes the tcell event properly

func (*BufPane) HasKeyEvent Uses

func (h *BufPane) HasKeyEvent(e Event) bool

func (*BufPane) HelpCmd Uses

func (h *BufPane) HelpCmd(args []string)

HelpCmd tries to open the given help page in a horizontal split

func (*BufPane) ID Uses

func (h *BufPane) ID() uint64

func (*BufPane) IndentLine Uses

func (h *BufPane) IndentLine() bool

IndentLine moves the current line forward one indentation

func (*BufPane) IndentSelection Uses

func (h *BufPane) IndentSelection() bool

IndentSelection indents the current selection

func (*BufPane) InsertNewline Uses

func (h *BufPane) InsertNewline() bool

InsertNewline inserts a newline plus possible some whitespace if autoindent is on

func (*BufPane) InsertTab Uses

func (h *BufPane) InsertTab() bool

InsertTab inserts a tab or spaces

func (*BufPane) JumpLine Uses

func (h *BufPane) JumpLine() bool

OpenFile opens a new file in the buffer

func (*BufPane) JumpToMatchingBrace Uses

func (h *BufPane) JumpToMatchingBrace() bool

JumpToMatchingBrace moves the cursor to the matching brace if it is currently on a brace

func (*BufPane) MemUsageCmd Uses

func (h *BufPane) MemUsageCmd(args []string)

MemUsageCmd prints micro's memory usage Alloc shows how many bytes are currently in use Sys shows how many bytes have been requested from the operating system NumGC shows how many times the GC has been run Note that Go commonly reserves more memory from the OS than is currently in-use/required Additionally, even if Go returns memory to the OS, the OS does not always claim it because there may be plenty of memory to spare

func (*BufPane) MouseMultiCursor Uses

func (h *BufPane) MouseMultiCursor(e *tcell.EventMouse) bool

MouseMultiCursor is a mouse action which puts a new cursor at the mouse position

func (*BufPane) MousePress Uses

func (h *BufPane) MousePress(e *tcell.EventMouse) bool

MousePress is the event that should happen when a normal click happens This is almost always bound to left click

func (*BufPane) MoveLinesDown Uses

func (h *BufPane) MoveLinesDown() bool

MoveLinesDown moves down the current line or selected lines if any

func (*BufPane) MoveLinesUp Uses

func (h *BufPane) MoveLinesUp() bool

MoveLinesUp moves up the current line or selected lines if any

func (*BufPane) Name Uses

func (h *BufPane) Name() string

func (*BufPane) NewTabCmd Uses

func (h *BufPane) NewTabCmd(args []string)

NewTabCmd opens the given file in a new tab

func (*BufPane) NextSplit Uses

func (h *BufPane) NextSplit() bool

NextSplit changes the view to the next split

func (*BufPane) NextTab Uses

func (h *BufPane) NextTab() bool

NextTab switches to the next tab in the tab list

func (*BufPane) None Uses

func (h *BufPane) None() bool

None is an action that does nothing

func (*BufPane) OpenBuffer Uses

func (h *BufPane) OpenBuffer(b *buffer.Buffer)

func (*BufPane) OpenCmd Uses

func (h *BufPane) OpenCmd(args []string)

OpenCmd opens a new buffer with a given filename

func (*BufPane) OpenFile Uses

func (h *BufPane) OpenFile() bool

OpenFile opens a new file in the buffer

func (*BufPane) OpenLogBuf Uses

func (h *BufPane) OpenLogBuf()

OpenLogBuf opens the log buffer from the current bufpane If the current bufpane is a log buffer nothing happens, otherwise the log buffer is opened in a horizontal split

func (*BufPane) OutdentLine Uses

func (h *BufPane) OutdentLine() bool

OutdentLine moves the current line back one indentation

func (*BufPane) OutdentSelection Uses

func (h *BufPane) OutdentSelection() bool

OutdentSelection takes the current selection and moves it back one indent level

func (*BufPane) PageDown Uses

func (h *BufPane) PageDown() bool

PageDown scrolls the view down a page

func (*BufPane) PageUp Uses

func (h *BufPane) PageUp() bool

PageUp scrolls the view up a page

func (*BufPane) ParagraphNext Uses

func (h *BufPane) ParagraphNext() bool

ParagraphNext moves the cursor to the next empty line, or end of the buffer if there's none

func (*BufPane) ParagraphPrevious Uses

func (h *BufPane) ParagraphPrevious() bool

ParagraphPrevious moves the cursor to the previous empty line, or beginning of the buffer if there's none

func (*BufPane) Paste Uses

func (h *BufPane) Paste() bool

Paste whatever is in the system clipboard into the buffer Delete and paste if the user has a selection

func (*BufPane) PastePrimary Uses

func (h *BufPane) PastePrimary() bool

PastePrimary pastes from the primary clipboard (only use on linux)

func (*BufPane) PlayMacro Uses

func (h *BufPane) PlayMacro() bool

PlayMacro plays back the most recently recorded macro

func (*BufPane) PluginCB Uses

func (h *BufPane) PluginCB(cb string) bool

PluginCB calls all plugin callbacks with a certain name and displays an error if there is one and returns the aggregrate boolean response

func (*BufPane) PluginCBRune Uses

func (h *BufPane) PluginCBRune(cb string, r rune) bool

PluginCBRune is the same as PluginCB but also passes a rune to the plugins

func (*BufPane) PluginCmd Uses

func (h *BufPane) PluginCmd(args []string)

PluginCmd installs, removes, updates, lists, or searches for given plugins

func (*BufPane) PreviousSplit Uses

func (h *BufPane) PreviousSplit() bool

PreviousSplit changes the view to the previous split

func (*BufPane) PreviousTab Uses

func (h *BufPane) PreviousTab() bool

PreviousTab switches to the previous tab in the tab list

func (*BufPane) PwdCmd Uses

func (h *BufPane) PwdCmd(args []string)

PwdCmd prints the current working directory

func (*BufPane) Quit Uses

func (h *BufPane) Quit() bool

Quit this will close the current tab or view that is open

func (*BufPane) QuitAll Uses

func (h *BufPane) QuitAll() bool

QuitAll quits the whole editor; all splits and tabs

func (*BufPane) QuitCmd Uses

func (h *BufPane) QuitCmd(args []string)

QuitCmd closes the main view

func (*BufPane) RawCmd Uses

func (h *BufPane) RawCmd(args []string)

RawCmd opens a new raw view which displays the escape sequences micro is receiving in real-time

func (*BufPane) Redo Uses

func (h *BufPane) Redo() bool

Redo redoes the last action

func (*BufPane) ReloadCmd Uses

func (h *BufPane) ReloadCmd(args []string)

ReloadCmd reloads all files (syntax files, colorschemes...)

func (*BufPane) RemoveAllMultiCursors Uses

func (h *BufPane) RemoveAllMultiCursors() bool

RemoveAllMultiCursors removes all cursors except the base cursor

func (*BufPane) RemoveMultiCursor Uses

func (h *BufPane) RemoveMultiCursor() bool

RemoveMultiCursor removes the latest multiple cursor

func (*BufPane) ReopenCmd Uses

func (h *BufPane) ReopenCmd(args []string)

ReopenCmd reopens the buffer (reload from disk)

func (*BufPane) ReplaceAllCmd Uses

func (h *BufPane) ReplaceAllCmd(args []string)

ReplaceAllCmd replaces search term all at once

func (*BufPane) ReplaceCmd Uses

func (h *BufPane) ReplaceCmd(args []string)

ReplaceCmd runs search and replace

func (*BufPane) ResetCmd Uses

func (h *BufPane) ResetCmd(args []string)

ResetCmd resets a setting to its default value

func (*BufPane) ResizePane Uses

func (h *BufPane) ResizePane(size int)

func (*BufPane) Retab Uses

func (h *BufPane) Retab() bool

Retab changes all tabs to spaces or all spaces to tabs depending on the user's settings

func (*BufPane) RetabCmd Uses

func (h *BufPane) RetabCmd(args []string)

RetabCmd changes all spaces to tabs or all tabs to spaces depending on the user's settings

func (*BufPane) RunCmd Uses

func (h *BufPane) RunCmd(args []string)

RunCmd runs a shell command in the background

func (*BufPane) Save Uses

func (h *BufPane) Save() bool

Save the buffer to disk

func (*BufPane) SaveAll Uses

func (h *BufPane) SaveAll() bool

SaveAll saves all open buffers

func (*BufPane) SaveAs Uses

func (h *BufPane) SaveAs() bool

SaveAs saves the buffer to disk with the given name

func (*BufPane) SaveAsCB Uses

func (h *BufPane) SaveAsCB(action string, callback func()) bool

SaveAsCB performs a save as and does a callback at the very end (after all prompts have been resolved) The callback is only called if the save was successful

func (*BufPane) SaveCB Uses

func (h *BufPane) SaveCB(action string, callback func()) bool

SaveCB performs a save and does a callback at the very end (after all prompts have been resolved)

func (*BufPane) SaveCmd Uses

func (h *BufPane) SaveCmd(args []string)

SaveCmd saves the buffer optionally with an argument file name

func (*BufPane) ScrollDown Uses

func (h *BufPane) ScrollDown(n int)

ScrollDown is not an action

func (*BufPane) ScrollDownAction Uses

func (h *BufPane) ScrollDownAction() bool

ScrollDownAction scrolls the view up

func (*BufPane) ScrollUp Uses

func (h *BufPane) ScrollUp(n int)

ScrollUp is not an action

func (*BufPane) ScrollUpAction Uses

func (h *BufPane) ScrollUpAction() bool

ScrollUpAction scrolls the view up

func (*BufPane) SelectAll Uses

func (h *BufPane) SelectAll() bool

SelectAll selects the entire buffer

func (*BufPane) SelectDown Uses

func (h *BufPane) SelectDown() bool

SelectDown selects down one line

func (*BufPane) SelectLeft Uses

func (h *BufPane) SelectLeft() bool

SelectLeft selects the character to the left of the cursor

func (*BufPane) SelectLine Uses

func (h *BufPane) SelectLine() bool

SelectLine selects the entire current line

func (*BufPane) SelectPageDown Uses

func (h *BufPane) SelectPageDown() bool

SelectPageDown selects down one page

func (*BufPane) SelectPageUp Uses

func (h *BufPane) SelectPageUp() bool

SelectPageUp selects up one page

func (*BufPane) SelectRight Uses

func (h *BufPane) SelectRight() bool

SelectRight selects the character to the right of the cursor

func (*BufPane) SelectToEnd Uses

func (h *BufPane) SelectToEnd() bool

SelectToEnd selects the text from the cursor to the end of the buffer

func (*BufPane) SelectToEndOfLine Uses

func (h *BufPane) SelectToEndOfLine() bool

SelectToEndOfLine selects to the end of the current line

func (*BufPane) SelectToStart Uses

func (h *BufPane) SelectToStart() bool

SelectToStart selects the text from the cursor to the start of the buffer

func (*BufPane) SelectToStartOfLine Uses

func (h *BufPane) SelectToStartOfLine() bool

SelectToStartOfLine selects to the start of the current line

func (*BufPane) SelectToStartOfText Uses

func (h *BufPane) SelectToStartOfText() bool

SelectToStartOfText selects to the start of the text on the current line

func (*BufPane) SelectToStartOfTextToggle Uses

func (h *BufPane) SelectToStartOfTextToggle() bool

SelectToStartOfTextToggle toggles the selection between the start of the text on the current line and the start of the line

func (*BufPane) SelectUp Uses

func (h *BufPane) SelectUp() bool

SelectUp selects up one line

func (*BufPane) SelectWordLeft Uses

func (h *BufPane) SelectWordLeft() bool

SelectWordLeft selects the word to the left of the cursor

func (*BufPane) SelectWordRight Uses

func (h *BufPane) SelectWordRight() bool

SelectWordRight selects the word to the right of the cursor

func (*BufPane) SetActive Uses

func (h *BufPane) SetActive(b bool)

func (*BufPane) SetCmd Uses

func (h *BufPane) SetCmd(args []string)

SetCmd sets an option

func (*BufPane) SetID Uses

func (h *BufPane) SetID(i uint64)

func (*BufPane) SetLocalCmd Uses

func (h *BufPane) SetLocalCmd(args []string)

SetLocalCmd sets an option local to the buffer

func (*BufPane) SetTab Uses

func (h *BufPane) SetTab(t *Tab)

func (*BufPane) ShellMode Uses

func (h *BufPane) ShellMode() bool

ShellMode opens a terminal to run a shell command

func (*BufPane) ShowCmd Uses

func (h *BufPane) ShowCmd(args []string)

ShowCmd shows the value of the given option

func (*BufPane) ShowKeyCmd Uses

func (h *BufPane) ShowKeyCmd(args []string)

ShowKeyCmd displays the action that a key is bound to

func (*BufPane) SkipMultiCursor Uses

func (h *BufPane) SkipMultiCursor() bool

SkipMultiCursor moves the current multiple cursor to the next available position

func (*BufPane) SpawnMultiCursor Uses

func (h *BufPane) SpawnMultiCursor() bool

SpawnMultiCursor creates a new multiple cursor at the next occurrence of the current selection or current word

func (*BufPane) SpawnMultiCursorDown Uses

func (h *BufPane) SpawnMultiCursorDown() bool

SpawnMultiCursorDown creates additional cursor, at the same X (if possible), one Y more.

func (*BufPane) SpawnMultiCursorSelect Uses

func (h *BufPane) SpawnMultiCursorSelect() bool

SpawnMultiCursorSelect adds a cursor at the beginning of each line of a selection

func (*BufPane) SpawnMultiCursorUp Uses

func (h *BufPane) SpawnMultiCursorUp() bool

SpawnMultiCursorUp creates additional cursor, at the same X (if possible), one Y less.

func (*BufPane) Start Uses

func (h *BufPane) Start() bool

Start moves the viewport to the start of the buffer

func (*BufPane) StartOfLine Uses

func (h *BufPane) StartOfLine() bool

StartOfLine moves the cursor to the start of the line

func (*BufPane) StartOfText Uses

func (h *BufPane) StartOfText() bool

StartOfText moves the cursor to the start of the text of the line

func (*BufPane) StartOfTextToggle Uses

func (h *BufPane) StartOfTextToggle() bool

StartOfTextToggle toggles the cursor between the start of the text of the line and the start of the line

func (*BufPane) Suspend Uses

func (*BufPane) Suspend() bool

Suspend sends micro to the background. This is the same as pressing CtrlZ in most unix programs. This only works on linux and has no default binding. This code was adapted from the suspend code in nsf/godit

func (*BufPane) Tab Uses

func (h *BufPane) Tab() *Tab

func (*BufPane) TabMoveCmd Uses

func (h *BufPane) TabMoveCmd(args []string)

TabMoveCmd moves the current tab to a given index (starts at 1). The displaced tabs are moved up.

func (*BufPane) TabSwitchCmd Uses

func (h *BufPane) TabSwitchCmd(args []string)

TabSwitchCmd switches to a given tab either by name or by number

func (*BufPane) TermCmd Uses

func (h *BufPane) TermCmd(args []string)

TermCmd opens a terminal in the current view

func (*BufPane) TextFilterCmd Uses

func (h *BufPane) TextFilterCmd(args []string)

TextFilterCmd filters the selection through the command. Selection goes to the command input. On successful run command output replaces the current selection.

func (*BufPane) ToggleDiffGutter Uses

func (h *BufPane) ToggleDiffGutter() bool

ToggleDiffGutter turns the diff gutter off and on

func (*BufPane) ToggleHelp Uses

func (h *BufPane) ToggleHelp() bool

ToggleHelp toggles the help screen

func (*BufPane) ToggleKeyMenu Uses

func (h *BufPane) ToggleKeyMenu() bool

ToggleKeyMenu toggles the keymenu option and resizes all tabs

func (*BufPane) ToggleLogCmd Uses

func (h *BufPane) ToggleLogCmd(args []string)

ToggleLogCmd toggles the log view

func (*BufPane) ToggleMacro Uses

func (h *BufPane) ToggleMacro() bool

ToggleMacro toggles recording of a macro

func (*BufPane) ToggleOverwriteMode Uses

func (h *BufPane) ToggleOverwriteMode() bool

ToggleOverwriteMode lets the user toggle the text overwrite mode

func (*BufPane) ToggleRuler Uses

func (h *BufPane) ToggleRuler() bool

ToggleRuler turns line numbers off and on

func (*BufPane) UnbindCmd Uses

func (h *BufPane) UnbindCmd(args []string)

UnbindCmd binds a key to its default action

func (*BufPane) Undo Uses

func (h *BufPane) Undo() bool

Undo undoes the last action

func (*BufPane) Unsplit Uses

func (h *BufPane) Unsplit() bool

Unsplit closes all splits in the current tab except the active one

func (*BufPane) VSplitAction Uses

func (h *BufPane) VSplitAction() bool

VSplitAction opens an empty vertical split

func (*BufPane) VSplitBuf Uses

func (h *BufPane) VSplitBuf(buf *buffer.Buffer) *BufPane

func (*BufPane) VSplitCmd Uses

func (h *BufPane) VSplitCmd(args []string)

VSplitCmd opens a vertical split with file given in the first argument If no file is given, it opens an empty buffer in a new split

func (*BufPane) VSplitIndex Uses

func (h *BufPane) VSplitIndex(buf *buffer.Buffer, right bool) *BufPane

func (*BufPane) WordLeft Uses

func (h *BufPane) WordLeft() bool

WordLeft moves the cursor one word to the left

func (*BufPane) WordRight Uses

func (h *BufPane) WordRight() bool

WordRight moves the cursor one word to the right

type Command Uses

type Command struct {
    // contains filtered or unexported fields
}

A Command contains information about how to execute a command It has the action for that command as well as a completer function

type Event Uses

type Event interface{}

type Handler Uses

type Handler interface {
    HandleEvent(tcell.Event)
    HandleCommand(string)
}

A Handler will take a tcell event and execute it appropriately

type InfoKeyAction Uses

type InfoKeyAction func(*InfoPane)

type InfoPane Uses

type InfoPane struct {
    *BufPane
    *info.InfoBuf
}
var InfoBar *InfoPane

func GetInfoBar Uses

func GetInfoBar() *InfoPane

GetInfoBar returns the infobar pane

func NewInfoBar Uses

func NewInfoBar() *InfoPane

func NewInfoPane Uses

func NewInfoPane(ib *info.InfoBuf, w display.BWindow, tab *Tab) *InfoPane

func (*InfoPane) Autocomplete Uses

func (h *InfoPane) Autocomplete()

Autocomplete begins autocompletion

func (*InfoPane) Close Uses

func (h *InfoPane) Close()

func (*InfoPane) CursorDown Uses

func (h *InfoPane) CursorDown()

CursorDown cycles history down

func (*InfoPane) CursorUp Uses

func (h *InfoPane) CursorUp()

CursorUp cycles history up

func (*InfoPane) DoKeyEvent Uses

func (h *InfoPane) DoKeyEvent(e KeyEvent) bool

DoKeyEvent executes a key event for the command bar, doing any overridden actions

func (*InfoPane) Escape Uses

func (h *InfoPane) Escape()

Escape cancels the prompt

func (*InfoPane) HandleEvent Uses

func (h *InfoPane) HandleEvent(event tcell.Event)

func (*InfoPane) InsertNewline Uses

func (h *InfoPane) InsertNewline()

InsertNewline completes the prompt

func (*InfoPane) Quit Uses

func (h *InfoPane) Quit()

Quit cancels the prompt

func (*InfoPane) QuitAll Uses

func (h *InfoPane) QuitAll()

QuitAll cancels the prompt

type KeyAction Uses

type KeyAction func(Handler) bool

type KeyEvent Uses

type KeyEvent struct {
    // contains filtered or unexported fields
}

KeyEvent is a key event containing a key code, some possible modifiers (alt, ctrl, etc...) and a rune if it was simply a character press Note: to be compatible with tcell events, for ctrl keys r=code

type MouseAction Uses

type MouseAction func(Handler, tcell.EventMouse) bool

type MouseEvent Uses

type MouseEvent struct {
    // contains filtered or unexported fields
}

MouseEvent is a mouse event with a mouse button and any possible key modifiers

type Pane Uses

type Pane interface {
    Handler
    display.Window
    ID() uint64
    SetID(i uint64)
    Name() string
    Close()
    SetTab(t *Tab)
    Tab() *Tab
}

type RawEvent Uses

type RawEvent struct {
    // contains filtered or unexported fields
}

RawEvent is simply an escape code We allow users to directly bind escape codes to get around some of a limitations of terminals

type RawPane Uses

type RawPane struct {
    *BufPane
}

func NewRawPane Uses

func NewRawPane(tab *Tab) *RawPane

func NewRawPaneFromWin Uses

func NewRawPaneFromWin(b *buffer.Buffer, win display.BWindow, tab *Tab) *RawPane

func (*RawPane) HandleEvent Uses

func (h *RawPane) HandleEvent(event tcell.Event)

type Tab Uses

type Tab struct {
    *views.Node
    *display.UIWindow
    Panes []Pane
    // contains filtered or unexported fields
}

A Tab represents a single tab It consists of a list of edit panes (the open buffers), a split tree (stored as just the root node), and a uiwindow to display the UI elements like the borders between splits

func MainTab Uses

func MainTab() *Tab

func NewTabFromBuffer Uses

func NewTabFromBuffer(x, y, width, height int, b *buffer.Buffer) *Tab

NewTabFromBuffer creates a new tab from the given buffer

func NewTabFromPane Uses

func NewTabFromPane(x, y, width, height int, pane Pane) *Tab

func (*Tab) CurPane Uses

func (t *Tab) CurPane() *BufPane

CurPane returns the currently active pane

func (*Tab) GetPane Uses

func (t *Tab) GetPane(splitid uint64) int

GetPane returns the pane with the given split index

func (*Tab) HandleEvent Uses

func (t *Tab) HandleEvent(event tcell.Event)

HandleEvent takes a tcell event and usually dispatches it to the current active pane. However if the event is a resize or a mouse event where the user is interacting with the UI (resizing splits) then the event is consumed here If the event is a mouse event in a pane, that pane will become active and get the event

func (*Tab) RemovePane Uses

func (t *Tab) RemovePane(i int)

Remove pane removes the pane with the given index

func (*Tab) Resize Uses

func (t *Tab) Resize()

Resize resizes all panes according to their corresponding split nodes

func (*Tab) SetActive Uses

func (t *Tab) SetActive(i int)

SetActive changes the currently active pane to the specified index

type TabList Uses

type TabList struct {
    *display.TabWindow
    List []*Tab
}

The TabList is a list of tabs and a window to display the tab bar at the top of the screen

var Tabs *TabList

Tabs is the global tab list

func NewTabList Uses

func NewTabList(bufs []*buffer.Buffer) *TabList

NewTabList creates a TabList from a list of buffers by creating a Tab for each buffer

func (*TabList) AddTab Uses

func (t *TabList) AddTab(p *Tab)

AddTab adds a new tab to this TabList

func (*TabList) Display Uses

func (t *TabList) Display()

Display updates the names and then displays the tab bar

func (*TabList) HandleEvent Uses

func (t *TabList) HandleEvent(event tcell.Event)

HandleEvent checks for a resize event or a mouse event on the tab bar otherwise it will forward the event to the currently active tab

func (*TabList) RemoveTab Uses

func (t *TabList) RemoveTab(id uint64)

RemoveTab removes a tab with the given id from the TabList

func (*TabList) Resize Uses

func (t *TabList) Resize()

Resize resizes all elements within the tab list One thing to note is that when there is only 1 tab the tab bar should not be drawn so resizing must take that into account

func (*TabList) UpdateNames Uses

func (t *TabList) UpdateNames()

UpdateNames makes sure that the list of names the tab window has access to is correct

type TermPane Uses

type TermPane struct {
    *shell.Terminal
    display.Window
    // contains filtered or unexported fields
}

func NewTermPane Uses

func NewTermPane(x, y, w, h int, t *shell.Terminal, id uint64, tab *Tab) (*TermPane, error)

func (*TermPane) Close Uses

func (t *TermPane) Close()

func (*TermPane) HandleCommand Uses

func (t *TermPane) HandleCommand(input string)

func (*TermPane) HandleEvent Uses

func (t *TermPane) HandleEvent(event tcell.Event)

HandleEvent handles a tcell event by forwarding it to the terminal emulator If the event is a mouse event and the program running in the emulator does not have mouse support, the emulator will support selections and copy-paste

func (*TermPane) ID Uses

func (t *TermPane) ID() uint64

func (*TermPane) Quit Uses

func (t *TermPane) Quit()

func (*TermPane) SetID Uses

func (t *TermPane) SetID(i uint64)

func (*TermPane) SetTab Uses

func (t *TermPane) SetTab(tab *Tab)

func (*TermPane) Tab Uses

func (t *TermPane) Tab() *Tab

func (*TermPane) Unsplit Uses

func (t *TermPane) Unsplit()

Package action imports 33 packages (graph). Updated 2020-05-29. Refresh now. Tools for package owners.