refactor: drop dead code and use the standard library where it already does the job
CI / Checks (pull_request) Successful in 37s
PR title / Conventional title (pull_request) Successful in 1s

No behaviour change.

- Deleted, unused or one-line wrappers: panes.RuneIndexes, Detail.Refresh (SetDescribed does it), SecretValue.Len, Query.Empty, Clipboard.Native, config.Load, get's value, Model.done, providerOf (cachefile.ProviderOf), contextWithTimeout, searchCoverage, startCrawl, showKeybindings, the expiry aliases and daysLeft.
- cmp.Or instead of the two cmpOr copies; slices.Sorted(maps.Keys(…)), maps.Copy, wg.Go, utf8.RuneCountInString and new(true) instead of loops and helpers that do the same.
- A container's pane title is set once, not twice; a redundant length check in share links and a no-op assignment in linkhandler.Launch are gone.
- Tests call ansi.Strip and lastLines directly; gofmt -s on links.go.
This commit is contained in:
keb committed 2026-10-15 08:54:42 +02:00
1 parent b1eda53d5d
commit 19299631b8
43 files changed
+161 -304

No files matched your search

+2 -7
View File
@@ -3,8 +3,8 @@ package styles
import (
"fmt"
"image/color"
"maps"
"slices"
"sort"
"strconv"
"strings"
@@ -51,12 +51,7 @@ var Roles = map[string]string{
func FromTheme(theme map[string][]string) (Styles, color.Color, error) {
st := Default()
var fg color.Color
roles := make([]string, 0, len(theme))
for r := range theme {
roles = append(roles, r)
}
sort.Strings(roles)
for _, role := range roles {
for _, role := range slices.Sorted(maps.Keys(theme)) {
if _, ok := Roles[role]; !ok {
continue
}