Пример #1
0
func NewManager(p *plugin.Plugin) *Manager {
	m := &Manager{nvim: p.Nvim, docs: make(map[int]*data), highlights: make(map[nvim.Window]*windowHighlight)}
	p.Handle("doc.onUpdateHighlight", m.onUpdateHighlight)
	p.Handle("doc.onBufDelete", m.onBufDelete)
	p.Handle("doc.onJump", m.onJump)
	return m
}
Пример #2
0
func Register(p *plugin.Plugin) {
	e := &explorer{docm: doc.NewManager(p), nvim: p.Nvim}
	p.HandleCommand(&plugin.CommandOptions{Name: "Godoc", NArgs: "*", Complete: "customlist,QQQDocComplete", Eval: "*"}, e.onDoc)
	p.HandleCommand(&plugin.CommandOptions{Name: "Godef", NArgs: "*", Complete: "customlist,QQQDocComplete", Eval: "*"}, e.onDef)
	p.HandleFunction(&plugin.FunctionOptions{Name: "QQQDocComplete", Eval: "*"}, e.onComplete)
	p.HandleAutocmd(&plugin.AutocmdOptions{Event: "BufReadCmd", Pattern: bufNamePrefix + "**", Eval: "*"}, e.onBufReadCmd)
}
Пример #3
0
func Register(p *plugin.Plugin) {
	p.HandleCommand(&plugin.CommandOptions{Name: "Fmt", Range: "%", Eval: "*"}, format)
}