actions

package
v0.0.0-...-0efad91 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoFile = errors.New("Can not save empty filename or nil buffer.")
View Source
var PlumbingReady bool

This boolean indicates whether plumbing is ready to be used. It should generally only be called by the main thread to flag that plumb messages are fine to use.

Until the main thread does that, plumb will fail, assuming that it hasn't been properly initialized.

Functions

func Alias

func Alias(args string, buff *demodel.CharBuffer, v demodel.Viewport)

Alias registers an alias for execution commands. It requires two parameters: a name, and a value. When a command is executed by either pressing enter or middle clicking, if the name is a prefix of the command, it's replaced by the value before getting executed. This allows you to make replacements such as Alias:s/:|sed:s/ in order to make the command s/foo/bar/ replaced by |sed:s/foo/bar/ and pipe the current selection through sed. There are no restrictions on names or values, other than that the name can not contain a space, since it's used as a delimiter when registering the alias.

func CopyClipboard

func CopyClipboard(From, To demodel.Position, buff *demodel.CharBuffer)

func CutClipboard

func CutClipboard(From, To demodel.Position, buff *demodel.CharBuffer)

func DeleteCursor

func DeleteCursor(From, To demodel.Position, buff *demodel.CharBuffer)

func Do

func Do(cmd string, buff *demodel.CharBuffer, v demodel.Viewport)

Do does a built in action that's been registered.

func FindNext

func FindNext(From, To demodel.Position, buff *demodel.CharBuffer)

Changes Dot to next instance of the character sequence between From and To

func FindNextOrOpen

func FindNextOrOpen(From, To demodel.Position, buff *demodel.CharBuffer, v demodel.Viewport)

func FindNextOrOpenTag

func FindNextOrOpenTag(From, To demodel.Position, buff *demodel.CharBuffer, v demodel.Viewport)

func FocusViewport

func FocusViewport(idx uint, buff *demodel.CharBuffer, v demodel.Viewport) error

Focus the viewport v (which is assumed to be rendering buff), such that the character at buff.Buffer[idx] is visible somewhere on the screen.

func InsertSnarfBuffer

func InsertSnarfBuffer(From, To demodel.Position, buff *demodel.CharBuffer)

func MoveCursor

func MoveCursor(From, To demodel.Position, buff *demodel.CharBuffer)

func OpenFile

func OpenFile(filename string, buff *demodel.CharBuffer, v demodel.Viewport) error

func OpenOrPerformAction

func OpenOrPerformAction(From, To demodel.Position, buff *demodel.CharBuffer, v demodel.Viewport)

func OpenOrPerformTagAction

func OpenOrPerformTagAction(From, To demodel.Position, buff *demodel.CharBuffer, v demodel.Viewport)

func PasteClipboard

func PasteClipboard(From, To demodel.Position, buff *demodel.CharBuffer)

func PerformAction

func PerformAction(From, To demodel.Position, buff *demodel.CharBuffer, v demodel.Viewport)

func PerformTagAction

func PerformTagAction(From, To demodel.Position, buff *demodel.CharBuffer, v demodel.Viewport)

func PlumbExecuteOrFindNext

func PlumbExecuteOrFindNext(From, To demodel.Position, buff *demodel.CharBuffer, v demodel.Viewport)

func PlumbOrFindNext

func PlumbOrFindNext(From, To demodel.Position, buff *demodel.CharBuffer, v demodel.Viewport)

func RegisterAction

func RegisterAction(cmd string, f func(string, *demodel.CharBuffer, demodel.Viewport))

func RunOrExec

func RunOrExec(cmd string, buff *demodel.CharBuffer, v demodel.Viewport) error

func SaveFile

func SaveFile(From, To demodel.Position, buff *demodel.CharBuffer) error

func TagPlumbOrFindNext

func TagPlumbOrFindNext(From, To demodel.Position, buff *demodel.CharBuffer, v demodel.Viewport)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL