mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 09:15:57 +02:00
Limit the number of selections displayed in the footer
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user