From 303864d1db77f940591d78ac597619c0cb0c46a5 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Sun, 8 Apr 2018 14:35:59 -0400 Subject: [PATCH] added matching for < > pairs --- lib/buf.c | 12 ++---------- lib/job.c | 2 -- tide.c | 2 +- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/buf.c b/lib/buf.c index 7665010..6f9bd5a 100644 --- 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)) diff --git a/lib/job.c b/lib/job.c index 171a256..b8c7ea6 100644 --- 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 79036f6..9c4e750 100644 --- 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); -- 2.51.0