mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 14:47:16 +09:00
Adding explicit checks for initlua for different plugin commands
This commit is contained in:
@@ -609,7 +609,7 @@ func UpdatePlugins(out io.Writer, plugins []string) {
|
|||||||
// if no plugins are specified, update all installed plugins.
|
// if no plugins are specified, update all installed plugins.
|
||||||
if len(plugins) == 0 {
|
if len(plugins) == 0 {
|
||||||
for _, p := range Plugins {
|
for _, p := range Plugins {
|
||||||
if !p.IsLoaded() || p.Builtin {
|
if !p.IsLoaded() || p.Builtin || p.Name == "initlua" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
plugins = append(plugins, p.Name)
|
plugins = append(plugins, p.Name)
|
||||||
@@ -668,6 +668,10 @@ func PluginCommand(out io.Writer, cmd string, args []string) {
|
|||||||
case "remove":
|
case "remove":
|
||||||
removed := ""
|
removed := ""
|
||||||
for _, plugin := range args {
|
for _, plugin := range args {
|
||||||
|
if plugin == "initlua" {
|
||||||
|
fmt.Fprintln(out, "initlua cannot be removed, but can be disabled via settings.")
|
||||||
|
continue
|
||||||
|
}
|
||||||
// check if the plugin exists.
|
// check if the plugin exists.
|
||||||
for _, p := range Plugins {
|
for _, p := range Plugins {
|
||||||
if p.Name == plugin && p.Builtin {
|
if p.Name == plugin && p.Builtin {
|
||||||
@@ -692,7 +696,9 @@ func PluginCommand(out io.Writer, cmd string, args []string) {
|
|||||||
plugins := GetInstalledVersions(false)
|
plugins := GetInstalledVersions(false)
|
||||||
fmt.Fprintln(out, "The following plugins are currently installed:")
|
fmt.Fprintln(out, "The following plugins are currently installed:")
|
||||||
for _, p := range plugins {
|
for _, p := range plugins {
|
||||||
if p.Pack().Builtin {
|
if p.Pack().Name == "initlua" {
|
||||||
|
fmt.Fprintf(out, "%s\n", "initlua")
|
||||||
|
} else if p.Pack().Builtin {
|
||||||
fmt.Fprintf(out, "%s (built-in)\n", p.Pack().Name)
|
fmt.Fprintf(out, "%s (built-in)\n", p.Pack().Name)
|
||||||
} else {
|
} else {
|
||||||
fmt.Fprintf(out, "%s (%s)\n", p.Pack().Name, p.Version)
|
fmt.Fprintf(out, "%s (%s)\n", p.Pack().Name, p.Version)
|
||||||
|
|||||||
Reference in New Issue
Block a user