mirror of https://github.com/Hilbis/Hilbish
feat: dont put input in history if it starts with a space
parent
f2a2ac44d6
commit
8c802a6e6b
7
main.go
7
main.go
|
@ -184,6 +184,7 @@ input:
|
||||||
// If we get a completely random error, print
|
// If we get a completely random error, print
|
||||||
fmt.Fprintln(os.Stderr, err)
|
fmt.Fprintln(os.Stderr, err)
|
||||||
}
|
}
|
||||||
|
oldInput := input
|
||||||
|
|
||||||
input = strings.TrimSpace(input)
|
input = strings.TrimSpace(input)
|
||||||
if len(input) == 0 {
|
if len(input) == 0 {
|
||||||
|
@ -202,7 +203,11 @@ input:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
handleHistory(input)
|
|
||||||
|
// if input has space at the beginning, dont put in history
|
||||||
|
if !strings.HasPrefix(oldInput, " ") {
|
||||||
|
handleHistory(input)
|
||||||
|
}
|
||||||
runInput(input)
|
runInput(input)
|
||||||
|
|
||||||
termwidth, _, err := term.GetSize(0)
|
termwidth, _, err := term.GetSize(0)
|
||||||
|
|
Loading…
Reference in New Issue