diff options
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 9e097a54a4..6b66d8733e 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -2345,6 +2345,15 @@ int ExpandBufnames(char_u *pat, int *num_file, char_u ***file, int options) if (!buf->b_p_bl) { // skip unlisted buffers continue; } + if (options & BUF_DIFF_FILTER) { + // Skip buffers not suitable for + // :diffget or :diffput completion. + if (buf == curbuf + || !diff_mode_buf(curbuf) + || !diff_mode_buf(buf)) { + continue; + } + } p = buflist_match(®match, buf, p_wic); if (p != NULL) { if (round == 1) { |