From: Michael D. Lowis Date: Mon, 25 Feb 2019 01:17:49 +0000 (-0500) Subject: misc bug fixes X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=d30d1c4c0b6d246f21b93e40a7e07fc6b08bacbc;p=projs%2Ftide.git misc bug fixes --- diff --git a/TODO.md b/TODO.md index 80d388d..a325c53 100644 --- a/TODO.md +++ b/TODO.md @@ -13,6 +13,7 @@ * refactor selection handling to avoid swapping manually (use buf_selbeg and buf_selend) * encode EOL setting in log entries? * implement a mini-sed command to standardize scripts across platforms without relying on sed +* add tag to enable/disable scrolling on command output insertion Tags: diff --git a/bin/picktag b/bin/picktag index 73d41c2..8901ba2 100755 --- a/bin/picktag +++ b/bin/picktag @@ -38,8 +38,9 @@ fetch(){ sub(/^\//, "\"", matchstr) sub(/\$?\/;"$/, "\"", matchstr) gsub(/\*/, "\\*", matchstr) - gsub(/(\[|\])/, "\\\1", matchstr) - print "grep -Hn", matchstr, $2, "| cut -d: -f1,2" + gsub(/\[/, "\\[", matchstr) + gsub(/\]/, "\\]", matchstr) + print "grep -Hn", matchstr, $2, "| cut -d: -f1,2" } ' "$TAGFILE" | /bin/sh | pick) [ "" != "$file" ] && edit "$file" diff --git a/config.mk b/config.mk index 5c6e7d6..f32c2a8 100644 --- a/config.mk +++ b/config.mk @@ -17,7 +17,7 @@ INCS += -I/usr/include/freetype2 # Compiler Setup CC = ./acc -CFLAGS = -MMD $(INCS) +CFLAGS = -O2 -MMD $(INCS) CFLAGS += -Wno-missing-field-initializers -Wno-implicit-fallthrough # Linker Setup diff --git a/src/lib/view.c b/src/lib/view.c index 8166921..40d2865 100644 --- a/src/lib/view.c +++ b/src/lib/view.c @@ -16,16 +16,17 @@ static void move_selection(View* view, bool extsel, int move, movefn_t bything) view->sync_flags |= CURSOR; if (buf_selsz(BUF) && !extsel) { buf_selclr(BUF, move); + buf_getcol(BUF); } else { CSRPOS = bything(BUF, CSRPOS, move); if (bything == buf_byline) buf_setcol(BUF); if (!extsel) buf_selclr(BUF, RIGHT); + /* only update column if not moving vertically */ + if (bything != buf_byline) + buf_getcol(BUF); } - /* only update column if not moving vertically */ - if (bything != buf_byline) - buf_getcol(BUF); } static void move_to(View* view, bool extsel, size_t off) { diff --git a/src/registrar.c b/src/registrar.c index bfaea70..3bb9e57 100644 --- a/src/registrar.c +++ b/src/registrar.c @@ -219,7 +219,7 @@ int daemonize(void) { /* clear any inherited umask(2) value */ umask(0); - chdir("/"); + if (chdir("/") < 0){} close(0), close(1), close(2); return 0; }