From 6c44ed14f9cbee804206529f0f133157ac46eb5b Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 16 Jan 2017 10:15:25 -0500 Subject: [PATCH] Fixed crappy implementation of chomp with slightly less crappy version of chomp --- TODO.md | 8 ++++++++ lib/utils.c | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 48338d6..29dc2ff 100644 --- a/TODO.md +++ b/TODO.md @@ -2,6 +2,7 @@ Up Next: +* Right click in tags region should search edit region * Implement X Selection protocol for handling clipboard and primary selections * Add keyboard shortcut to highlight the thing under the cursor * Tag line count should account for wrapped lines @@ -9,9 +10,12 @@ Up Next: * invalid memory accesses while viewing docs/waf * check for file changes on save * check for file changes when window regains focus +* Use $SHELL if defined, fallback on /bin/sh +* Set ENV to ~/.config/edit/rc if undefined The Rest: +* Selection bug when selecting text with tabs * add a distinct state for pointer move versus drag * Add a SaveAs tag that takes an argument for the filename to save as * Add a GoTo tag for ctags lookup and line number jump @@ -22,6 +26,10 @@ The Rest: * 100% coverage with unit and unit-integration tests * shortcut to repeat previous operation +The Future: + +* Run commands in the background and don't block the main thread. + # Auxillary Programs * Acme-like window manager diff --git a/lib/utils.c b/lib/utils.c index 78f9bed..f2b3444 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -90,6 +90,8 @@ char* fdgets(int fd) { } char* chomp(char* in) { - return strtok(in, "\r\n"); + char* pos = strrchr(in, '\n'); + if (pos) *pos = '\0'; + return in; } -- 2.52.0