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)
ae7dba8969
This commit is contained in:
Jan Edmund Lazo
2021-02-13 18:04:39 -05:00
parent fd44bd4d4f
commit 54cd7298f8
7 changed files with 65 additions and 1 deletions

View File

@@ -3512,6 +3512,13 @@ const char * set_one_cmd_context(
xp->xp_context = EXPAND_BUFFERS;
xp->xp_pattern = (char_u *)arg;
break;
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 = (char_u *)arg;
break;
case CMD_USER:
case CMD_USER_BUF:
if (context != EXPAND_NOTHING) {
@@ -5174,6 +5181,7 @@ static const char *command_complete[] =
[EXPAND_CSCOPE] = "cscope",
[EXPAND_USER_DEFINED] = "custom",
[EXPAND_USER_LIST] = "customlist",
[EXPAND_DIFF_BUFFERS] = "diff_buffer",
[EXPAND_DIRECTORIES] = "dir",
[EXPAND_ENV_VARS] = "environment",
[EXPAND_EVENTS] = "event",