refactor: drop dead code and use the standard library where it already does the job
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:
43 files changed
+161
-304
No files matched your search
@@ -991,11 +991,11 @@ func TestRebindingShowsEverywhere(t *testing.T) {
|
||||
if !strings.Contains(scr, "z to reveal") || strings.Contains(scr, "space to reveal") {
|
||||
t.Errorf("detail hint doesn't follow the binding:\n%s", scr)
|
||||
}
|
||||
if !strings.Contains(lastLine(scr), "z show") {
|
||||
t.Errorf("help bar: %q", lastLine(scr))
|
||||
if !strings.Contains(lastLines(scr, 1), "z show") {
|
||||
t.Errorf("help bar: %q", lastLines(scr, 1))
|
||||
}
|
||||
d.keys("z")
|
||||
if bar := lastLine(d.screen()); !strings.Contains(bar, "z hide") {
|
||||
if bar := lastLines(d.screen(), 1); !strings.Contains(bar, "z hide") {
|
||||
t.Errorf("help bar with the value shown: %q", bar)
|
||||
}
|
||||
d.keys("z")
|
||||
@@ -1125,7 +1125,7 @@ func TestAccountPane(t *testing.T) {
|
||||
if !strings.Contains(scr, "Alice Example") {
|
||||
t.Errorf("account not shown:\n%s", scr)
|
||||
}
|
||||
bar := lastLine(scr)
|
||||
bar := lastLines(scr, 1)
|
||||
if !strings.Contains(bar, "copy") || strings.Contains(bar, "reveal") || strings.Contains(bar, "versions") {
|
||||
t.Errorf("help bar: %q", bar)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user