micro-editor/micro · error
Plugin %s: %s
Error message
Plugin %s: %s
What it means
Returned by config.RunPluginFn when any loaded plugin's Lua call to the given hook function returns a runtime error other than ErrNoSuchFunction (which means the plugin simply doesn't define the hook). The error is prefixed with the plugin's name so you know which plugin misbehaved; note only the LAST failing plugin's error is kept.
Source
Thrown at internal/config/plugin.go:36
err := p.Load()
if err != nil {
reterr = err
}
}
return reterr
}
// RunPluginFn runs a given function in all plugins
// returns an error if any of the plugins had an error
func RunPluginFn(fn string, args ...lua.LValue) error {
var reterr error
for _, p := range Plugins {
if !p.IsLoaded() {
continue
}
_, err := p.Call(fn, args...)
if err != nil && err != ErrNoSuchFunction {
reterr = errors.New("Plugin " + p.Name + ": " + err.Error())
}
}
return reterr
}
// RunPluginFnBool runs a function in all plugins and returns
// false if any one of them returned false
// also returns an error if any of the plugins had an error
func RunPluginFnBool(settings map[string]any, fn string, args ...lua.LValue) (bool, error) {
var reterr error
retbool := true
for _, p := range Plugins {
if !p.IsLoaded() || (settings != nil && settings[p.Name] == false) {
continue
}
val, err := p.Call(fn, args...)
if err == ErrNoSuchFunction {
continueView on GitHub (pinned to 1c8b82b32e)
Solutions
- Read the message: the plugin name and Lua error pinpoint the file/line in the plugin.
- Update the plugin: git pull in ~/.config/micro/plug/<name> or reinstall via the plugin manager.
- Disable the plugin: set "plugin name": false in settings.json (or remove its folder) to unblock your editing session.
- If it is your own plugin, fix the Lua: the error text usually contains the Lua source line; test with `micro -config-dir $(mktemp -d)` isolating it.
Example fix
-- before (plugin myplug/init.lua): function onBufChange(buf) local t = buf[1].x end -- buf[1] nil -> runtime error -- after: function onBufChange(buf) if #buf > 0 then local x = buf[1].X end end
Defensive patterns
Strategy: try-catch
Try / catch
if err := config.RunPluginFn("onBufChange", lua.LString("changed")); err != nil {
if strings.HasPrefix(err.Error(), "Plugin ") {
name := strings.SplitN(strings.TrimPrefix(err.Error(), "Plugin "), ":", 2)[0]
// disable offender: config.GlobalSettings[name] = false; log and continue
}
} Prevention
- Keep plugins updated; most 'Plugin X:' errors after upgrades are API-drift fixes upstream.
- As a plugin author, wrap hook bodies in pcall during development so your errors self-contain.
- Maintain a known-good set: pin plugin commits in ~/.config/micro/plug and test before micro upgrades.
When it happens
Trigger: A plugin's Lua hook (e.g. onBufChange, onToggleKey, onExit) raising a Lua runtime error — indexing a nil global, calling a removed micro API function, bad argument types. p.Call executes the plugin's Lua; any error at internal/config/plugin.go:36 becomes 'Plugin <name>: <lua error>'.
Common situations: Plugin written for an older micro Lua API after a micro upgrade (renamed/removed functions), a plugin whose init.lua had runtime issues that only manifest on certain events, or half-updated plugin installs.
Related errors
AI-assisted analysis of micro-editor/micro@1c8b82b32e (2026-08-15).
Data as JSON: /api/errors/b24fb8302097ccd7.
Report an issue: GitHub.