mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-15 11:48:15 +08:00
Fix panic when histlist is empty.
This commit is contained in:
parent
02a38a7ac3
commit
34e785ce02
|
@ -68,7 +68,11 @@ func (hl *histlist) ModeTitle(i int) string {
|
|||
if hl.dedup {
|
||||
dedup = " (dedup)"
|
||||
}
|
||||
return fmt.Sprintf(" HISTORY #%d%s ", hl.index[i], dedup)
|
||||
idx := ""
|
||||
if i >= 0 {
|
||||
idx = fmt.Sprintf(" #%d", hl.index[i])
|
||||
}
|
||||
return fmt.Sprintf(" HISTORY%s%s ", idx, dedup)
|
||||
}
|
||||
|
||||
func startHistlist(ed *Editor) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user