]> git.mdlowis.com Git - projs/tide.git/commitdiff
added matching for < > pairs
authorMichael D. Lowis <mike@mdlowis.com>
Sun, 8 Apr 2018 18:35:59 +0000 (14:35 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Sun, 8 Apr 2018 18:35:59 +0000 (14:35 -0400)
lib/buf.c
lib/job.c
tide.c

index 766501072a0b908041b177b80ab556beb7fb0d3c..6f9bd5a14267ba199e8f6dcda898dcfeaf37dec4 100644 (file)
--- a/lib/buf.c
+++ b/lib/buf.c
@@ -251,16 +251,6 @@ size_t buf_eol(Buf* buf, size_t off) {
     return off;
 }
 
-size_t buf_bow(Buf* buf, size_t off) {
-    for (; risword(buf_getrat(buf, off-1)); off--);
-    return off;
-}
-
-size_t buf_eow(Buf* buf, size_t off) {
-    for (; risword(buf_getrat(buf, off)); off++);
-    return off;
-}
-
 void buf_selline(Buf* buf) {
     Sel sel = getsel(buf);
     sel.beg = buf_bol(buf, sel.end);
@@ -289,6 +279,8 @@ void buf_selctx(Buf* buf, bool (*isword)(Rune)) {
         selblock(buf, '[', ']');
     else if (r == '{' || r == '}')
         selblock(buf, '{', '}');
+    else if (r == '<' || r == '>')
+        selblock(buf, '<', '>');
     else if (buf->selection.end == bol || r == '\n')
         buf_selline(buf);
     else if (risword(r))
index 171a256367f40b9761db20a944235c6596a82c38..b8c7ea6cceb35a0516a9513368faed94f8b0719c 100644 (file)
--- a/lib/job.c
+++ b/lib/job.c
@@ -30,9 +30,7 @@ bool job_poll(int ms) {
         if (JobFds[njobs].events) njobs++;
     }
     /* Poll until a job is ready, call the functions based on events */
-    //printf("poll(..., %d, %d)", njobs, ms);
     long ret = poll(JobFds, njobs, ms);
-    //printf(" => %ld\n", ret);
     for (int i = 0; i < njobs; i++)
         job_process(JobFds[i].fd, JobFds[i].revents);
     /* reap zombie processes */
diff --git a/tide.c b/tide.c
index 79036f6bbe4de4ba65ea73b8aab69dde0fc32f71..9c4e75004c38d7d531a8fa97290ce038eda0ea67 100644 (file)
--- a/tide.c
+++ b/tide.c
@@ -222,7 +222,7 @@ static void cmd_exec(char* cmd) {
     execcmd[2] = cmd;
 
     /* get the selection that the command will operate on */
-    if (op && op != '<' && op != '!' && 0 == view_selsize(win_view(EDIT)))
+    if (op && op != '<' && op != '!' && !view_selsize(win_view(EDIT)))
         view_selectall(win_view(EDIT));
     char* input = view_getstr(win_view(EDIT));
     size_t len  = (input ? strlen(input) : 0);