diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-02-13 18:04:39 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-02-13 18:17:25 -0500 |
commit | 54cd7298f8aa6adfa5a629b13ecb71b7779798bd (patch) | |
tree | 87e43c1069dc189a241f8fb834cb28871a0ef47f /src/nvim/ex_docmd.c | |
parent | fd44bd4d4feb884460fd9f023b162f5ee166aae0 (diff) | |
download | rneovim-54cd7298f8aa6adfa5a629b13ecb71b7779798bd.tar.gz rneovim-54cd7298f8aa6adfa5a629b13ecb71b7779798bd.tar.bz2 rneovim-54cd7298f8aa6adfa5a629b13ecb71b7779798bd.zip |
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
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index ef11107779..35f6503ce4 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -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", |