From 54cd7298f8aa6adfa5a629b13ecb71b7779798bd Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 13 Feb 2021 18:04:39 -0500 Subject: vim-patch:8.2.0054: :diffget and :diffput don't have good completion Problem: :diffget and :diffput don't have good completion. Solution: Add proper completion. (Dominique Pelle, closes vim/vim#5409) https://github.com/vim/vim/commit/ae7dba896975051a3f0b7123faa08dac5635972d --- src/nvim/buffer.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/nvim/buffer.c') 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) { -- cgit