summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-02-11 17:16:52 +0100
committerOskar <[email protected]>2024-02-11 17:16:52 +0100
commitdd8b6d127e366ace19860781b00812e44c0c4a27 (patch)
tree3aa5dad659519add0f5ba8fd01959d62cd581c53
parentd6b12bc33c2c34a9554480456e2262935a4ea556 (diff)
new + and - feature to increment and decrement the focus. I will make it more advanced.
-rwxr-xr-x7edbin0 -> 766048 bytes
-rw-r--r--Makefile2
-rw-r--r--startmode.c8
3 files changed, 9 insertions, 1 deletions
diff --git a/7ed b/7ed
new file mode 100755
index 0000000..5e05ffc
--- /dev/null
+++ b/7ed
Binary files differ
diff --git a/Makefile b/Makefile
index b2e88de..d4371ce 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-CC=gcc
+CC=gcc #gcc works best here, mostly because i experienced errors in clang that i dont care to deal with quite yet.
CFLAGS=-Wfatal-errors -Wall -Werror -Wextra -g -O2 -static
CFLAGS_TESTBIN=-Wfatal-errors -Wall -Werror -Wextra -g -fsanitize=address
TARGET=7ed
diff --git a/startmode.c b/startmode.c
index d90f785..bf948ce 100644
--- a/startmode.c
+++ b/startmode.c
@@ -68,6 +68,14 @@ int startmode(char filename[]) {
if (buf[0] == '\n') {
goto firstwhile; // If the user presses enter then we just goto start of the main loop
}
+ if (buf[0] == '+') { // if user inputs + then increment by 1
+ Lfocus = focus+1;
+ break;
+ }
+ if (buf[0] == '-') { // If user inputs - then decrement by 1
+ Lfocus = focus-1;
+ break;
+ }
char *endptr;