From dd8b6d127e366ace19860781b00812e44c0c4a27 Mon Sep 17 00:00:00 2001 From: Oskar Date: Sun, 11 Feb 2024 17:16:52 +0100 Subject: new + and - feature to increment and decrement the focus. I will make it more advanced. --- 7ed | Bin 0 -> 766048 bytes Makefile | 2 +- startmode.c | 8 ++++++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 7ed diff --git a/7ed b/7ed new file mode 100755 index 0000000..5e05ffc Binary files /dev/null and b/7ed 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; -- cgit v1.2.3