lua

package
v0.0.0-...-ee8958b Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EditorCommand

type EditorCommand struct {
	Name        string
	Description string

	Completion *lua.LFunction
}

Defines an editor command and completion.

The completion function is called every keystroke after the user invokes the completion keybind ( TAB ). The function returns plausible suggestions based of the current input ( as a string ) or an empty string if the user hasn't provided any arguments.

Examples:

{
  Name = "HelloWorld",
  Description= "Puts a friendly message in the console",
}

{
  Name = "ComplexCommand",
  Description = "A really, really complicated command",

  Completion = function (arguments)
    print(arguments) -- string, e.g. hello world
    return response
  end
}

type PluginMeta

type PluginMeta struct {
	// Plugin details
	Name        string
	Version     string
	Description string
	Homepage    string
	Source      string

	// Plugin "Actions"
	Hooks    map[string]lua.LFunction
	Commands []EditorCommand
}

Defines a plugin's details and actions.

func LoadPlugin

func LoadPlugin(name string) (*PluginMeta, error)

Loads a plugin by name from micropad plugin directory

Jump to

Keyboard shortcuts

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