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:
parent
7272e035d9
commit
1d4c8a7645
@ -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
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
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user