diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-02-13 18:17:57 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-02-13 18:22:04 -0500 |
commit | e87c30a1963b59d1f9c27aa99faf26960b12265f (patch) | |
tree | dee20deb341d963e1f695db172cabb1bec27fdb7 /src/nvim/buffer.c | |
parent | 54cd7298f8aa6adfa5a629b13ecb71b7779798bd (diff) | |
download | rneovim-e87c30a1963b59d1f9c27aa99faf26960b12265f.tar.gz rneovim-e87c30a1963b59d1f9c27aa99faf26960b12265f.tar.bz2 rneovim-e87c30a1963b59d1f9c27aa99faf26960b12265f.zip |
vim-patch:8.2.0064: diffmode completion doesn't use per-window setting
Problem: Diffmode completion doesn't use per-window setting.
Solution: Check if a window is in diff mode. (Dominique Pell, closes vim/vim#5419)
https://github.com/vim/vim/commit/efcc329020ef089267f5f3994b8544eb58806311
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 6b66d8733e..c42a0e2dad 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -2309,6 +2309,10 @@ int ExpandBufnames(char_u *pat, int *num_file, char_u ***file, int options) *num_file = 0; // return values in case of FAIL *file = NULL; + if ((options & BUF_DIFF_FILTER) && !curwin->w_p_diff) { + return FAIL; + } + // Make a copy of "pat" and change "^" to "\(^\|[\/]\)". if (*pat == '^') { patc = xmalloc(STRLEN(pat) + 11); @@ -2348,9 +2352,7 @@ int ExpandBufnames(char_u *pat, int *num_file, char_u ***file, int options) 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)) { + if (buf == curbuf || !diff_mode_buf(buf)) { continue; } } |