mirror of https://github.com/Hilbis/Hilbish
fix: dont add last empty line of history, make sure first isnt missing in search
parent
5175367b35
commit
88fd6f01b9
|
@ -20,8 +20,13 @@ func newFileHistory() (*fileHistory, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var itms []string
|
itms := []string{""}
|
||||||
for _, l := range strings.Split(string(data), "\n") {
|
lines := strings.Split(string(data), "\n")
|
||||||
|
for i, l := range lines {
|
||||||
|
if i == len(lines) - 1 {
|
||||||
|
println(i, l)
|
||||||
|
continue
|
||||||
|
}
|
||||||
itms = append(itms, l)
|
itms = append(itms, l)
|
||||||
}
|
}
|
||||||
f, err := os.OpenFile(defaultHistPath, os.O_RDWR | os.O_CREATE, 0755)
|
f, err := os.OpenFile(defaultHistPath, os.O_RDWR | os.O_CREATE, 0755)
|
||||||
|
|
Loading…
Reference in New Issue