packages

package
v0.0.0-...-ae9aa4e Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2015 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Package

type Package interface {
	// Returns the path of the package
	Name() string

	// Depending on the implemented package
	// returns useful data for python plugin is
	// python files for setting is file content
	Get() interface{}

	// Reloads package data
	Reload()
}

type Packet

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

Packets are small Packages containing 1 file. Individual settings, keymaps, snippets, etc. are Packets

func NewPacket

func NewPacket(path string, marshal json.Unmarshaler) *Packet

Initializes new packet with specific path

func (*Packet) FileChanged

func (p *Packet) FileChanged(name string)

Forces editor to load the packet again

func (*Packet) Get

func (p *Packet) Get() interface{}

Returns packet file data if any error occurred on reading file we will return nil

func (*Packet) Load

func (p *Packet) Load() error

func (*Packet) MarshalTo

func (p *Packet) MarshalTo() json.Unmarshaler

func (*Packet) Name

func (p *Packet) Name() string

func (*Packet) UnmarshalJSON

func (p *Packet) UnmarshalJSON(data []byte) error

type Packets

type Packets []*Packet

Useful for managing packets for plugins and loading user packets for editor

func (Packets) Filter

func (p Packets) Filter(key string) Packets

Returns Packets with specific type

type Plugin

type Plugin struct {
	text.HasSettings
	keys.HasKeyBindings
	// contains filtered or unexported fields
}

Plugin is a Package type containing some files with specific suffix that could be interpreted by lime text api(currently python) and some settings, snippets, commands and etc as packets

func NewPlugin

func NewPlugin(path string, suffix string) (p *Plugin)

Initializes a new plugin whith loading all of the settings, keymaps and etc. Suffix variable show's which file types we need for plugin for example if the plugin is written in python the suffix should be ".py". We will use this function at initialization to add user plugins and on new_plugin command

func ScanPlugins

func ScanPlugins(path string, suffix string) []*Plugin

Scaning path for finding plugins that contain files whith specific suffix

func (*Plugin) Get

func (p *Plugin) Get() interface{}

Returns slice of files with plugin suffix loaded at initialization

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) Reload

func (p *Plugin) Reload()

On plugin reload we will scan for plugin files and packets in plugin path

Jump to

Keyboard shortcuts

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