summaryrefslogtreecommitdiff
path: root/src/cmdexpand.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-12-29 13:56:33 +0100
committerBram Moolenaar <Bram@vim.org>2019-12-29 13:56:33 +0100
commitae7dba896975051a3f0b7123faa08dac5635972d (patch)
tree4535b38de33959b00eccc8a18194fe6e83d3f353 /src/cmdexpand.c
parente20e68b40d9572393bb3577d6a0b52e960950b57 (diff)
downloadvim-git-ae7dba896975051a3f0b7123faa08dac5635972d.tar.gz
patch 8.2.0054: :diffget and :diffput don't have good completionv8.2.0054
Problem: :diffget and :diffput don't have good completion. Solution: Add proper completion. (Dominique Pelle, closes #5409)
Diffstat (limited to 'src/cmdexpand.c')
-rw-r--r--src/cmdexpand.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 1a7f9f2ec..9dc78ed5c 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -1582,7 +1582,15 @@ set_one_cmd_context(
xp->xp_context = EXPAND_BUFFERS;
xp->xp_pattern = arg;
break;
-
+#ifdef FEAT_DIFF
+ case CMD_diffget:
+ case CMD_diffput:
+ // If current buffer is in diff mode, complete buffer names
+ // which are in diff mode, and different than current buffer.
+ xp->xp_context = EXPAND_DIFF_BUFFERS;
+ xp->xp_pattern = arg;
+ break;
+#endif
case CMD_USER:
case CMD_USER_BUF:
if (compl != EXPAND_NOTHING)
@@ -2069,6 +2077,10 @@ ExpandFromContext(
return ExpandOldSetting(num_file, file);
if (xp->xp_context == EXPAND_BUFFERS)
return ExpandBufnames(pat, num_file, file, options);
+#ifdef FEAT_DIFF
+ if (xp->xp_context == EXPAND_DIFF_BUFFERS)
+ return ExpandBufnames(pat, num_file, file, options | BUF_DIFF_FILTER);
+#endif
if (xp->xp_context == EXPAND_TAGS
|| xp->xp_context == EXPAND_TAGS_LISTFILES)
return expand_tags(xp->xp_context == EXPAND_TAGS, pat, num_file, file);