Convert command to lowercase in the command palette (#1432)
parent
f41c22bce2
commit
a516775a81
|
|
@ -114,12 +114,13 @@ func (c *Command) run(cmd, path string, clearStack bool) error {
|
|||
return nil
|
||||
}
|
||||
cmds := strings.Split(cmd, " ")
|
||||
gvr, v, err := c.viewMetaFor(cmds[0])
|
||||
command := strings.ToLower(cmds[0])
|
||||
gvr, v, err := c.viewMetaFor(command)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
switch cmds[0] {
|
||||
switch command {
|
||||
case "ctx", "context", "contexts":
|
||||
if len(cmds) == 2 {
|
||||
return useContext(c.app, cmds[1])
|
||||
|
|
@ -139,7 +140,7 @@ func (c *Command) run(cmd, path string, clearStack bool) error {
|
|||
if err := c.app.switchNS(ns); err != nil {
|
||||
return err
|
||||
}
|
||||
if !c.alias.Check(cmds[0]) {
|
||||
if !c.alias.Check(command) {
|
||||
return fmt.Errorf("`%s` Command not found", cmd)
|
||||
}
|
||||
return c.exec(cmd, gvr, c.componentFor(gvr, path, v), clearStack)
|
||||
|
|
|
|||
Loading…
Reference in New Issue