mirror of https://github.com/Hilbis/Hilbish
Compare commits
3 Commits
c4438579f6
...
4e8aa7ed1d
Author | SHA1 | Date |
---|---|---|
TorchedSammy | 4e8aa7ed1d | |
TorchedSammy | 919a52a630 | |
TorchedSammy | b0c950a96a |
1
api.go
1
api.go
|
@ -325,6 +325,7 @@ func hlprompt(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
typ := "left"
|
typ := "left"
|
||||||
|
// optional 2nd arg
|
||||||
if len(c.Etc()) != 0 {
|
if len(c.Etc()) != 0 {
|
||||||
ltyp := c.Etc()[0]
|
ltyp := c.Etc()[0]
|
||||||
var ok bool
|
var ok bool
|
||||||
|
|
12
exec.go
12
exec.go
|
@ -42,13 +42,13 @@ func runInput(input string, priv bool) {
|
||||||
cmdFinish(0, input, priv)
|
cmdFinish(0, input, priv)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
input, exitCode, err = handleSh(cmdString)
|
input, exitCode, err = handleSh(input)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, err)
|
fmt.Fprintln(os.Stderr, err)
|
||||||
}
|
}
|
||||||
cmdFinish(exitCode, input, priv)
|
cmdFinish(exitCode, input, priv)
|
||||||
case "hybridRev":
|
case "hybridRev":
|
||||||
_, _, err = handleSh(cmdString)
|
_, _, err = handleSh(input)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
cmdFinish(0, input, priv)
|
cmdFinish(0, input, priv)
|
||||||
return
|
return
|
||||||
|
@ -65,7 +65,7 @@ func runInput(input string, priv bool) {
|
||||||
}
|
}
|
||||||
cmdFinish(exitCode, input, priv)
|
cmdFinish(exitCode, input, priv)
|
||||||
case "sh":
|
case "sh":
|
||||||
input, exitCode, err = handleSh(cmdString)
|
input, exitCode, err = handleSh(input)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, err)
|
fmt.Fprintln(os.Stderr, err)
|
||||||
}
|
}
|
||||||
|
@ -220,7 +220,11 @@ func execHandle(bg bool) interp.ExecHandlerFunc {
|
||||||
|
|
||||||
// If alias was found, use command alias
|
// If alias was found, use command alias
|
||||||
argstring = aliases.Resolve(argstring)
|
argstring = aliases.Resolve(argstring)
|
||||||
args, _ = shell.Fields(argstring, nil)
|
var err error
|
||||||
|
args, err = shell.Fields(argstring, nil)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If command is defined in Lua then run it
|
// If command is defined in Lua then run it
|
||||||
|
|
|
@ -85,6 +85,7 @@ const (
|
||||||
seqBold = "\x1b[1m"
|
seqBold = "\x1b[1m"
|
||||||
seqUnderscore = "\x1b[4m"
|
seqUnderscore = "\x1b[4m"
|
||||||
seqBlink = "\x1b[5m"
|
seqBlink = "\x1b[5m"
|
||||||
|
seqInvert = "\x1b[7m"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Text colours
|
// Text colours
|
||||||
|
|
|
@ -121,7 +121,7 @@ func (g *CompletionGroup) writeGrid(rl *Instance) (comp string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x == g.tcPosX && y == g.tcPosY) && (g.isCurrent) {
|
if (x == g.tcPosX && y == g.tcPosY) && (g.isCurrent) {
|
||||||
comp += seqCtermFg255 + seqFgBlackBright
|
comp += seqInvert
|
||||||
}
|
}
|
||||||
|
|
||||||
comp += fmt.Sprintf("%-"+cellWidth+"s %s", g.Suggestions[i], seqReset)
|
comp += fmt.Sprintf("%-"+cellWidth+"s %s", g.Suggestions[i], seqReset)
|
||||||
|
|
|
@ -188,7 +188,7 @@ func (g *CompletionGroup) writeList(rl *Instance) (comp string) {
|
||||||
// function highlights the cell depending on current selector place.
|
// function highlights the cell depending on current selector place.
|
||||||
highlight := func(y int, x int) string {
|
highlight := func(y int, x int) string {
|
||||||
if y == g.tcPosY && x == g.tcPosX && g.isCurrent {
|
if y == g.tcPosY && x == g.tcPosX && g.isCurrent {
|
||||||
return seqCtermFg255 + seqFgBlackBright
|
return seqInvert
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,7 @@ func (g *CompletionGroup) writeMap(rl *Instance) (comp string) {
|
||||||
// Highlighting function
|
// Highlighting function
|
||||||
highlight := func(y int) string {
|
highlight := func(y int) string {
|
||||||
if y == g.tcPosY && g.isCurrent {
|
if y == g.tcPosY && g.isCurrent {
|
||||||
return seqCtermFg255 + seqFgBlackBright
|
return seqInvert
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue