mirror of https://github.com/Hilbis/Hilbish
Compare commits
No commits in common. "4a4cb3409f20ee70f2ea726f6a2fb9a93bb847e1" and "3babf36c438da2da3f886eb1040f11857fd515fc" have entirely different histories.
4a4cb3409f
...
3babf36c43
|
@ -69,8 +69,6 @@ func binaryComplete(query, ctx string, fields []string) ([]string, string) {
|
|||
}
|
||||
}
|
||||
|
||||
completions = removeDupes(completions)
|
||||
|
||||
return completions, query
|
||||
}
|
||||
|
||||
|
|
2
exec.go
2
exec.go
|
@ -245,7 +245,7 @@ func splitInput(input string) ([]string, string) {
|
|||
func cmdFinish(code uint8, cmdstr, oldInput string) {
|
||||
// if input has space at the beginning, dont put in history
|
||||
if !strings.HasPrefix(oldInput, " ") || interactive {
|
||||
handleHistory(strings.TrimSpace(oldInput))
|
||||
handleHistory(cmdstr)
|
||||
}
|
||||
util.SetField(l, hshMod, "exitCode", lua.LNumber(code), "Exit code of last exected command")
|
||||
hooks.Em.Emit("command.exit", code, cmdstr)
|
||||
|
|
14
main.go
14
main.go
|
@ -187,7 +187,6 @@ input:
|
|||
|
||||
input = strings.TrimSpace(input)
|
||||
if len(input) == 0 {
|
||||
running = true
|
||||
hooks.Em.Emit("command.exit", 0)
|
||||
continue
|
||||
}
|
||||
|
@ -269,16 +268,3 @@ func expandHome(path string) string {
|
|||
|
||||
return strings.Replace(defaultHistDir, "~", homedir, 1)
|
||||
}
|
||||
|
||||
func removeDupes(slice []string) []string {
|
||||
all := make(map[string]bool)
|
||||
newSlice := []string{}
|
||||
for _, item := range slice {
|
||||
if _, val := all[item]; !val {
|
||||
all[item] = true
|
||||
newSlice = append(newSlice, item)
|
||||
}
|
||||
}
|
||||
|
||||
return newSlice
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue