summaryrefslogtreecommitdiff
path: root/shed_history.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@x1-nano.kaivo.local>2023-04-01 22:46:34 -0400
committerJakob Kaivo <jkk@x1-nano.kaivo.local>2023-04-01 22:46:34 -0400
commit23e9c66180b95e5b1ba03ae739c04ebefa183e05 (patch)
tree91dd9ac0d4270208b770bbc85766d5918c8e2d5a /shed_history.c
parent73611cd92215d478a549a6c869450376efc26393 (diff)
begin work on command history (need to fix so it doesn't clear screen)
Diffstat (limited to 'shed_history.c')
-rw-r--r--shed_history.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/shed_history.c b/shed_history.c
new file mode 100644
index 0000000..076554c
--- /dev/null
+++ b/shed_history.c
@@ -0,0 +1,18 @@
+#include <stddef.h>
+#include "shed.h"
+
+int shed_history_forward(struct shed *e)
+{
+ if (e->cur->next != NULL) {
+ e->cur = e->cur->next;
+ }
+ return shed_redraw(e);
+}
+
+int shed_history_backward(struct shed *e)
+{
+ if (e->cur->prev != NULL) {
+ e->cur = e->cur->prev;
+ }
+ return shed_redraw(e);
+}