diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-06-03 21:14:59 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-06-03 21:14:59 +0200 |
commit | 87abab92f5b42319a7b10df9974ed3ce5c9b2b9b (patch) | |
tree | ab0b61854d1fc219eac955f66fe90a378484efb6 /src/channel.c | |
parent | 98fb65cb051f625f4ce291a9f9cdb2e54ac1e688 (diff) | |
download | vim-git-87abab92f5b42319a7b10df9974ed3ce5c9b2b9b.tar.gz |
patch 8.1.1457: cannot reuse a buffer when loading a screen dumpv8.1.1457
Problem: Cannot reuse a buffer when loading a screen dump.
Solution: Add the "bufnr" option.
Diffstat (limited to 'src/channel.c')
-rw-r--r-- | src/channel.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/channel.c b/src/channel.c index 5ace0713d..c9bfd3e33 100644 --- a/src/channel.c +++ b/src/channel.c @@ -4901,6 +4901,32 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_set2 |= JO2_CURWIN; opt->jo_curwin = tv_get_number(item); } + else if (STRCMP(hi->hi_key, "bufnr") == 0) + { + int nr; + + if (!(supported2 & JO2_CURWIN)) + break; + opt->jo_set2 |= JO2_BUFNR; + nr = tv_get_number(item); + if (nr <= 0) + { + semsg(_(e_invargNval), hi->hi_key, tv_get_string(item)); + return FAIL; + } + opt->jo_bufnr_buf = buflist_findnr(nr); + if (opt->jo_bufnr_buf == NULL) + { + semsg(_(e_nobufnr), (long)nr); + return FAIL; + } + if (opt->jo_bufnr_buf->b_nwindows == 0 + || opt->jo_bufnr_buf->b_term == NULL) + { + semsg(_(e_invarg2), "bufnr"); + return FAIL; + } + } else if (STRCMP(hi->hi_key, "hidden") == 0) { if (!(supported2 & JO2_HIDDEN)) |