## STAGING
-* tide: ability to populate scratch buffer from stdin
* tfetch: read rules from rcfile in home and curr dir
+* tfetch: ls results instead of pcmanfm on right click directory
* tide: gap buffer does not handle UTF-8 currently
## BACKLOG
void job_spawn(int fd, jobfn_t readfn, jobfn_t writefn, void* data);
void job_start(char** cmd, char* data, size_t ndata, View* dest);
int job_run(char** cmd);
+void job_readfd(int fd, View* view);
/* Common Shortcuts
*****************************************************************************/
} while (!WIFEXITED(status) && !WIFSIGNALED(status));
return WEXITSTATUS(status);
}
+
+void job_readfd(int fd, View* view) {
+ struct PipeData* pipedata = calloc(1, sizeof(struct PipeData));
+ pipedata->dest = view;
+ job_spawn(fd, pipe_read, NULL, pipedata);
+}
} else {
if (fork()) exit(0); /* fork into background if we still have selection */
}
+
}
before = X.now;
}
if (*argv) {
char* path = realpath(*argv, NULL);
if (!path) path = strdup(*argv); /* if file doesnt exist, use the original name */
- view_init(win_view(EDIT), path);
- win_setln(line_num);
- win_title(path);
- win_prop_set("FILE", "file", path);
+ if (!strcmp("-", path)) {
+ job_readfd(STDIN_FILENO, win_view(EDIT));
+ } else {
+ view_init(win_view(EDIT), path);
+ win_setln(line_num);
+ win_title(path);
+ win_prop_set("FILE", "file", path);
+ }
free(path);
}