Limit the number of selections displayed in the footer
This commit is contained in:
parent
513fd720eb
commit
b4e75bf475
1 changed files with 6 additions and 1 deletions
|
|
@ -72,13 +72,18 @@ func (h *Handler) draw_footer() (num_lines int, err error) {
|
|||
flush()
|
||||
}
|
||||
if len(h.state.selections) > 0 {
|
||||
before := len(lines)
|
||||
w("", " Selected:", nil, "", nil)
|
||||
for _, s := range h.state.selections {
|
||||
for i, s := range h.state.selections {
|
||||
text := s
|
||||
if rel, rerr := filepath.Rel(h.state.CurrentDir(), s); rerr == nil {
|
||||
text = rel
|
||||
}
|
||||
w(" ", text, nil, s, func(abspath string) { h.state.ToggleSelection(abspath) })
|
||||
if len(lines)-before > 2 && len(h.state.selections)-i-1 > 3 {
|
||||
w(" ", fmt.Sprintf("and %d more…", len(h.state.selections)-1-i), nil, "", nil)
|
||||
break
|
||||
}
|
||||
}
|
||||
flush()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue