From e98decf9a68e41b09214aa60b77d0db29b7d648a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 2 Feb 2024 21:17:37 +0800 Subject: feat(quickfix): support -q - to read 'errorfile' from stdin (#27303) Note that this only works when stdin is a pipe. --- src/nvim/quickfix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/nvim/quickfix.c') 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; } -- cgit