aboutsummaryrefslogtreecommitdiff
path: root/lib/history.go
diff options
context:
space:
mode:
authorGalen Abell <galen@galenabell.com>2019-07-23 12:52:33 -0400
committerDrew DeVault <sir@cmpwn.com>2019-07-26 14:29:34 -0400
commit8635c70fda20b91f97c42f4e23e97bc01a14a89d (patch)
treeea70a40f7617782ca28060965ad253fa0e686161 /lib/history.go
parent67fb0938a66605a0b6a837005804637b348b250d (diff)
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.
Diffstat (limited to 'lib/history.go')
-rw-r--r--lib/history.go13
1 files changed, 13 insertions, 0 deletions
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()
+}