mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 06:48:17 +00:00
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)
efcc329020
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user