]> git.mdlowis.com Git - projs/tide.git/commitdiff
misc bug fixes
authorMichael D. Lowis <mike.lowis@gentex.com>
Mon, 25 Feb 2019 01:17:49 +0000 (20:17 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Mon, 25 Feb 2019 01:17:49 +0000 (20:17 -0500)
TODO.md
bin/picktag
config.mk
src/lib/view.c
src/registrar.c

diff --git a/TODO.md b/TODO.md
index 80d388d229e7d30966a4fec89e2b2ee8523f2a18..a325c5315cfdc3d68bc4a4d493096e1b0d0d0174 100644 (file)
--- 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:
 
index 73d41c29b381047214c347cea2ca54790ec31e2a..8901ba2de7c57f4716f9d6a5c2458e43a5e755f4 100755 (executable)
@@ -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"
index 5c6e7d64e0088e9751613dcb8328a78aa81d5b55..f32c2a829d3ba124cfda4740a2c1f1b208d7c831 100644 (file)
--- 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
index 8166921db222ea4a951b0290cd4a5c9c81c3fbab..40d28654432cc222beaf0e802c973443f8cfafaf 100644 (file)
@@ -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) {
index bfaea70132aa3be4d41bec194cdbe84f72582ac6..3bb9e57b7bb0f5d19c302fb33dec069c16c90bd7 100644 (file)
@@ -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;
 }