Skip to content

Commit 3951d7c

Browse files
Adding explicit checks for initlua for different plugin commands
1 parent 1096c4f commit 3951d7c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

internal/config/plugin_installer.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ func UpdatePlugins(out io.Writer, plugins []string) {
609609
// if no plugins are specified, update all installed plugins.
610610
if len(plugins) == 0 {
611611
for _, p := range Plugins {
612-
if !p.IsLoaded() || p.Builtin {
612+
if !p.IsLoaded() || p.Builtin || p.Name == "initlua" {
613613
continue
614614
}
615615
plugins = append(plugins, p.Name)
@@ -670,9 +670,9 @@ func PluginCommand(out io.Writer, cmd string, args []string) {
670670
for _, plugin := range args {
671671
// check if the plugin exists.
672672
for _, p := range Plugins {
673-
if p.Name == plugin && p.Builtin {
673+
if (p.Name == plugin && p.Builtin) || p.Name == "initlua" {
674674
fmt.Fprintln(out, "Built-in plugins cannot be removed, but can be disabled via settings.")
675-
continue
675+
break
676676
}
677677
if p.Name == plugin {
678678
UninstallPlugin(out, plugin)
@@ -692,7 +692,9 @@ func PluginCommand(out io.Writer, cmd string, args []string) {
692692
plugins := GetInstalledVersions(false)
693693
fmt.Fprintln(out, "The following plugins are currently installed:")
694694
for _, p := range plugins {
695-
if p.Pack().Builtin {
695+
if p.Pack().Name == "initlua" {
696+
fmt.Fprintf(out, "%s\n", "initlua")
697+
} else if p.Pack().Builtin {
696698
fmt.Fprintf(out, "%s (built-in)\n", p.Pack().Name)
697699
} else {
698700
fmt.Fprintf(out, "%s (%s)\n", p.Pack().Name, p.Version)

0 commit comments

Comments
 (0)