aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-07-31 21:42:47 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-07-31 21:49:36 -0400
commit309296545cf0c8556d82f81703eef4cdc7e539d3 (patch)
tree8e822eabc7e87f107d9aa92e15cd1253102c9158 /src/nvim/fileio.c
parent65578693b28008ca953e446158e31c267e5df7a3 (diff)
downloadrneovim-309296545cf0c8556d82f81703eef4cdc7e539d3.tar.gz
rneovim-309296545cf0c8556d82f81703eef4cdc7e539d3.tar.bz2
rneovim-309296545cf0c8556d82f81703eef4cdc7e539d3.zip
vim-patch:8.1.1780: warning for file no longer available is repeated
Problem: Warning for file no longer available is repeated every time Vim is focused. (Brian Armstrong) Solution: Only give the message once. (closes vim/vim#4748) https://github.com/vim/vim/commit/674e2bde6e7b0c468f304713aa8f97a45e1fcc89
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 907e6c978a..82cf79722e 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -4840,6 +4840,8 @@ buf_check_timestamp(
|| time_differs(file_info.stat.st_mtim.tv_sec, buf->b_mtime)
|| (int)file_info.stat.st_mode != buf->b_orig_mode
)) {
+ const long prev_b_mtime = buf->b_mtime;
+
retval = 1;
// set b_mtime to stop further warnings (e.g., when executing
@@ -4903,9 +4905,12 @@ buf_check_timestamp(
return 2;
}
if (!n) {
- if (*reason == 'd')
- mesg = _("E211: File \"%s\" no longer available");
- else {
+ if (*reason == 'd') {
+ // Only give the message once.
+ if (prev_b_mtime != -1) {
+ mesg = _("E211: File \"%s\" no longer available");
+ }
+ } else {
helpmesg = TRUE;
can_reload = TRUE;
/*