diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-11-23 20:15:08 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-11-23 20:15:08 +0100 |
commit | 9e40c4b15ebfbc84947a3f34b1bd53e397b57f51 (patch) | |
tree | d40f331175818b69219e5327e3f297707dc76d4f /src/quickfix.c | |
parent | f637bceb6135139dc1891a15de8fa134c2ca2d97 (diff) |
patch 8.2.2036: buffer messed up if creating the quickfix window failsv8.2.2036
Problem: Current buffer is messed up if creating a new buffer for the
quickfix window fails.
Solution: Check that creating the buffer succeeds. (closes #7352)
Diffstat (limited to 'src/quickfix.c')
-rw-r--r-- | src/quickfix.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index 40897b6b60..5e46ad2e95 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -4151,13 +4151,15 @@ qf_open_new_cwindow(qf_info_T *qi, int height) if (qf_buf != NULL) { // Use the existing quickfix buffer - (void)do_ecmd(qf_buf->b_fnum, NULL, NULL, NULL, ECMD_ONE, - ECMD_HIDE + ECMD_OLDBUF, oldwin); + if (do_ecmd(qf_buf->b_fnum, NULL, NULL, NULL, ECMD_ONE, + ECMD_HIDE + ECMD_OLDBUF, oldwin) == FAIL) + return FAIL; } else { // Create a new quickfix buffer - (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, oldwin); + if (do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, oldwin) == FAIL) + return FAIL; // save the number of the new buffer qi->qf_bufnr = curbuf->b_fnum; |