Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EditorOpener ¶
type EditorOpener interface { Open(string) (editor text.Editor, existed bool) CurrentEditor() text.Editor }
EditorOpener represents a type that can open a file, returning an editor.
type FileBinder ¶
type FileBinder interface { // FileBindables returns the bindables that should be registered // for the given file. FileBindables(path string) []bind.Bindable }
A FileBinder is a type that registers a list of commands on file open.
type FileChanger ¶
type FileChanger interface { // FileChanged will be called when the currently focused // file changes. FileChanged(oldPath, newPath string) }
A FileChanger is a type that just needs to be called when the open file changes.
type LineStarter ¶
LineStarter represents a type that knows which position lines start at.
type Location ¶
Location is a bind.MultiOp that knows how to focus locations in the code.
func NewLocation ¶
NewLocation returns a *Location bound to the passed in driver.
func (*Location) Exec ¶
Exec executes l against the values it has stored, returning an error if it encounters any problems.
type Opener ¶
type Opener interface {
Open(string)
}
Opener represents a type that can open a file, but doesn't return anything.
This is legacy code from before hooks existed and should be removed when all places that currently use it are converted to using hooks.
type Opt ¶
Opt is an option function that will apply to *Location types.
func Column ¶
Column takes a column number and returns an Opt that will modify a *Location to move carets to that column. Compatible with Line.
func Line ¶
Line takes a line number and returns an Opt that will modify a *Location to move carets to that line. Compatible with Column.
func Offset ¶
Offset takes a character offset and returns an Opt that will modify a *Location to move carets to that offset.
func Path ¶
Path takes a file path and returns an Opt that will modify a *Location to focus that file.
func SkipUnbind ¶
func SkipUnbind() Opt
SkipUnbind returns an Opt that modifies a *Location to skip the process of unbinding previously-bound commands. This is currently used to work around an issue that would leave the editor with *no* commands bound to it, as the final entry got popped ofl.