From 5e41a4cd4081ddb06e8e81ff779edf3f1f5e0a81 Mon Sep 17 00:00:00 2001 From: Qi Xiao Date: Wed, 24 Apr 2019 21:48:52 +0100 Subject: [PATCH] newedit/histlist: Cleanup. --- newedit/histlist/histlist.go | 4 ++-- newedit/histlist/histlist_test.go | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/newedit/histlist/histlist.go b/newedit/histlist/histlist.go index 6ae6880c..f0c2e540 100644 --- a/newedit/histlist/histlist.go +++ b/newedit/histlist/histlist.go @@ -23,14 +23,14 @@ func (m *Mode) Start(cmds []string) { Name: "HISTLIST", KeyHandler: m.KeyHandler, ItemsGetter: func(p string) listing.Items { - return getEntries(cmds, p) + return getItems(cmds, p) }, StartFilter: true, }) } // Given all commands, and a pattern, returning all matching entries. -func getEntries(cmds []string, p string) items { +func getItems(cmds []string, p string) items { // TODO: Show the real in-storage IDs of cmds, not their in-memory indicies. var entries []entry for i, line := range cmds { diff --git a/newedit/histlist/histlist_test.go b/newedit/histlist/histlist_test.go index 2bce4659..23f4bb54 100644 --- a/newedit/histlist/histlist_test.go +++ b/newedit/histlist/histlist_test.go @@ -11,8 +11,6 @@ import ( var Args = tt.Args -var testCmds = []string{} - func TestGetEntries(t *testing.T) { cmds := []string{ "put 1", @@ -21,7 +19,7 @@ func TestGetEntries(t *testing.T) { "repr 4", } - tt.Test(t, tt.Fn("getEntries", getEntries), tt.Table{ + tt.Test(t, tt.Fn("getEntries", getItems), tt.Table{ // Show all commands. Args(cmds, "").Rets(listing.MatchItems( styled.Unstyled(" 1 put 1"), @@ -42,7 +40,7 @@ func TestAccept(t *testing.T) { "put 1", "echo 2", } - entries := getEntries(cmds, "") + entries := getItems(cmds, "") st := types.State{} entries.Accept(0, &st)