diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-02-02 21:17:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-02 21:17:37 +0800 |
commit | e98decf9a68e41b09214aa60b77d0db29b7d648a (patch) | |
tree | 6a0a47d9f59209b1230637a55b10f25bb72c71d6 /src/nvim/quickfix.c | |
parent | 1bf645918e94e7e8f770592484164f1ee303f24e (diff) | |
download | rneovim-e98decf9a68e41b09214aa60b77d0db29b7d648a.tar.gz rneovim-e98decf9a68e41b09214aa60b77d0db29b7d648a.tar.bz2 rneovim-e98decf9a68e41b09214aa60b77d0db29b7d648a.zip |
feat(quickfix): support -q - to read 'errorfile' from stdin (#27303)
Note that this only works when stdin is a pipe.
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r-- | src/nvim/quickfix.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 801c00933a..14758c8cea 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -1065,7 +1065,9 @@ static int qf_setup_state(qfstate_T *pstate, char *restrict enc, const char *res } if (efile != NULL - && (pstate->fd = os_fopen(efile, "r")) == NULL) { + && (pstate->fd = (strequal(efile, "-") + ? fdopen(os_open_stdin_fd(), "r") + : os_fopen(efile, "r"))) == NULL) { semsg(_(e_openerrf), efile); return FAIL; } |