vim-patch:8.2.2231: when "--remote file" is used "file" is not reloaded

Problem:    When "--remote file" is used "file" is not reloaded.
Solution:   When a :drop command is used for a file that is already displayed
            in a window and it has not been changed, check if it needs to be
            reloaded. (closes vim/vim#7560)
e4862a0fe6

Remove unused "focus" parameter from "buf_check_timestamp()".
It was meant for removed GUI code.
This commit is contained in:
Jan Edmund Lazo
2020-12-27 14:24:54 -05:00
parent 883114e882
commit cff4cad25a
6 changed files with 23 additions and 11 deletions

View File

@@ -3392,7 +3392,7 @@ void ex_checktime(exarg_T *eap)
} else {
buf = buflist_findnr((int)eap->line2);
if (buf != NULL) { // cannot happen?
(void)buf_check_timestamp(buf, false);
(void)buf_check_timestamp(buf);
}
}
no_check_timestamps = save_no_check_timestamps;
@@ -3790,6 +3790,14 @@ void ex_drop(exarg_T *eap)
if (wp->w_buffer == buf) {
goto_tabpage_win(tp, wp);
curwin->w_arg_idx = 0;
if (!bufIsChanged(curbuf)) {
const int save_ar = curbuf->b_p_ar;
// reload the file if it is newer
curbuf->b_p_ar = 1;
buf_check_timestamp(curbuf);
curbuf->b_p_ar = save_ar;
}
return;
}
}