mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-19 23:14:55 +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()
|
flush()
|
||||||
}
|
}
|
||||||
if len(h.state.selections) > 0 {
|
if len(h.state.selections) > 0 {
|
||||||
|
before := len(lines)
|
||||||
w("", " Selected:", nil, "", nil)
|
w("", " Selected:", nil, "", nil)
|
||||||
for _, s := range h.state.selections {
|
for i, s := range h.state.selections {
|
||||||
text := s
|
text := s
|
||||||
if rel, rerr := filepath.Rel(h.state.CurrentDir(), s); rerr == nil {
|
if rel, rerr := filepath.Rel(h.state.CurrentDir(), s); rerr == nil {
|
||||||
text = rel
|
text = rel
|
||||||
}
|
}
|
||||||
w(" ", text, nil, s, func(abspath string) { h.state.ToggleSelection(abspath) })
|
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()
|
flush()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user