]> git.mdlowis.com Git - projs/tide.git/commitdiff
tweaked ctags rules to prevent opening an empty editor in some cases
authorMichael D. Lowis <mike.lowis@gentex.com>
Tue, 25 Jul 2017 14:07:45 +0000 (10:07 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Tue, 25 Jul 2017 14:07:45 +0000 (10:07 -0400)
tfetch.c

index 8f7a9c76fcac01040610eb9ec91cd2c781e3853f..22b53b29bfa49cc4650de4704a1a83fc60d01f39 100644 (file)
--- a/tfetch.c
+++ b/tfetch.c
@@ -47,9 +47,10 @@ Rule* BuiltinRules[] = {
         { COMPLETE, NULL, NULL }
     },
     (Rule[]){ // Look it up in ctags database
+        { ISSET, "EDITOR", NULL },
         { ISFILE, "tags", NULL },
-        { EXEC, "grep -q '^$data' tags", NULL },
-        { LAUNCH, "tide `picktag fetch tags '$data'`", NULL },
+        { EXEC, "grep -q '^$data\\s\\+' tags", NULL },
+        { LAUNCH, "picktag fetch tags '$data' | xargs -r tide", NULL },
         { COMPLETE, NULL, NULL }
     },
     (Rule[]){ // If it's an existing directory, open it with system default