Repository: zyedidia/micro
File: internal/config/plugin_installer.go (Go)

Code before:
			} else {
				for _, installed := range installedVersions {
					if pp.Name == installed.Pack().Name {
						if pp.Versions[0].Version.Compare(installed.Version) == 1 {
							fmt.Fprintln(out, pp.Name, " is already installed but out-of-date: use 'plugin update ", pp.Name, "' to update")
						} else {
							fmt.Fprintln(out, pp.Name, " is already installed")
						}
					}
				}
				pp.Install(out)
			}
		}

	case "remove":
		removed := ""
		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.
			for _, p := range Plugins {
				if p.Name == plugin && p.Builtin {
					fmt.Fprintln(out, "Built-in plugins cannot be removed, but can be disabled via settings.")
					break
				}
				if p.Name == plugin {
					UninstallPlugin(out, plugin)
					removed += plugin + " "
					continue
				}
			}
		}
		if removed != "" {
			fmt.Fprintln(out, "Removed ", removed)
		} else {
			fmt.Fprintln(out, "No plugins removed")
		}
	case "update":
		UpdatePlugins(out, args)
	case "list":
		plugins := GetInstalledVersions(false)
		fmt.Fprintln(out, "The following plugins are currently installed:")
		for _, p := range plugins {
			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)
			} else {
				fmt.Fprintf(out, "%s (%s)\n", p.Pack().Name, p.Version)

Review comment (suggestion):
If you really want to change it to `break` right away, what about the other `continue` below, in the successful case?

And before you rush to change it to `break` as well: have you investigated what exactly would be the consequences of these changes? What if there actually are multiple plugins with the same name? We probably don't want to allow that, but do we already prevent that? And if we don't, shouldn't we first of all implement preventing that? (In particular, a special case: we probably want to disallow `~/.config/micro/plug/initlua/`, since the name `initlua` is reserved for `init.lua`? Do we already do that?)

If you don't want to investigate that now, just leave this `continue` alone.

Code after:
			} else {
				for _, installed := range installedVersions {
					if pp.Name == installed.Pack().Name {
						if pp.Versions[0].Version.Compare(installed.Version) == 1 {
							fmt.Fprintln(out, pp.Name, " is already installed but out-of-date: use 'plugin update ", pp.Name, "' to update")
						} else {
							fmt.Fprintln(out, pp.Name, " is already installed")
						}
					}
				}
				pp.Install(out)
			}
		}

	case "remove":
		removed := ""
		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.
			for _, p := range Plugins {
				if p.Name == plugin && p.Builtin {
					fmt.Fprintln(out, p.Name, "is a built-in plugin which cannot be removed, but can be disabled via settings.")
					continue
				}
				if p.Name == plugin {
					UninstallPlugin(out, plugin)
					removed += plugin + " "
					continue
				}
			}
		}
		if removed != "" {
			fmt.Fprintln(out, "Removed ", removed)
		} else {
			fmt.Fprintln(out, "No plugins removed")
		}
	case "update":
		UpdatePlugins(out, args)
	case "list":
		plugins := GetInstalledVersions(false)
		fmt.Fprintln(out, "The following plugins are currently installed:")
		for _, p := range plugins {
			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)
			} else {
				fmt.Fprintf(out, "%s (%s)\n", p.Pack().Name, p.Version)