From 8635c70fda20b91f97c42f4e23e97bc01a14a89d Mon Sep 17 00:00:00 2001 From: Galen Abell Date: Tue, 23 Jul 2019 12:52:33 -0400 Subject: Add command history and cycling Aerc will keep track of the previous 1000 commands, which the user can cycle through using the arrow keys while in the ex-line. Pressing up will move backwards in history while pressing down will move forward. --- lib/history.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lib/history.go (limited to 'lib') diff --git a/lib/history.go b/lib/history.go new file mode 100644 index 0000000..abc081f --- /dev/null +++ b/lib/history.go @@ -0,0 +1,13 @@ +package lib + +// History represents a list of elements ordered by time. +type History interface { + // Add a new element to the history + Add(string) + // Get the next element in history + Next() string + // Get the previous element in history + Prev() string + // Reset the current location in history + Reset() +} -- cgit v1.2.3