2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-04-01 11:13:24 +00:00

feat: make history clear function work again

This commit is contained in:
TorchedSammy 2022-03-22 19:01:29 -04:00
parent 7272e035d9
commit 1d4c8a7645
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
2 changed files with 7 additions and 1 deletions

@ -78,3 +78,9 @@ func (h *fileHistory) Len() int {
func (h *fileHistory) Dump() interface{} {
return h.items
}
func (h *fileHistory) clear() {
h.items = []string{}
h.f.Truncate(0)
h.f.Sync()
}

2
rl.go

@ -271,6 +271,6 @@ func (lr *lineReader) luaAllHistory(L *lua.LState) int {
}
func (lr *lineReader) luaClearHistory(l *lua.LState) int {
fileHist.clear()
return 0
}