]> git.mdlowis.com Git - projs/tide.git/commitdiff
fixed logic for jobs so 0 output will delete the selection
authorMichael D. Lowis <mike.lowis@gentex.com>
Tue, 11 Dec 2018 19:33:50 +0000 (14:33 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Tue, 11 Dec 2018 19:33:50 +0000 (14:33 -0500)
src/lib/job.c

index c54f6ccca4d052ff7c2fb0d0df934c3714bfacb6..104e5ac0c73f3d535f2d05a9b67463fde0580c05 100644 (file)
@@ -28,7 +28,10 @@ static void pipe_read(Job* job) {
     if (nread <= 0) {
         job->readfn = NULL;
         buf_logstop(&pipedata->dest->buffer);
-        view_selprev(pipedata->dest);
+        if (view_selsize(pipedata->dest))
+            view_delete(pipedata->dest, RIGHT, false);
+        else
+            view_selprev(pipedata->dest);
     } else if (nread > 0) {
         buffer[nread] = '\0';
         buf_logstart(&pipedata->dest->buffer);