comparison src/fileio.c @ 17565:0026ea34a8d5 v8.1.1780

patch 8.1.1780: warning for file no longer available is repeated commit https://github.com/vim/vim/commit/674e2bde6e7b0c468f304713aa8f97a45e1fcc89 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 31 20:21:01 2019 +0200 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 #4748)
author Bram Moolenaar <Bram@vim.org>
date Wed, 31 Jul 2019 20:30:07 +0200
parents d4b2a212fa2f
children 65a8099fc0e8
comparison
equal deleted inserted replaced
17564:59dcae93845f 17565:0026ea34a8d5
6740 #else 6740 #else
6741 || mch_getperm(buf->b_ffname) != buf->b_orig_mode 6741 || mch_getperm(buf->b_ffname) != buf->b_orig_mode
6742 #endif 6742 #endif
6743 )) 6743 ))
6744 { 6744 {
6745 long prev_b_mtime = buf->b_mtime;
6746
6745 retval = 1; 6747 retval = 1;
6746 6748
6747 // set b_mtime to stop further warnings (e.g., when executing 6749 // set b_mtime to stop further warnings (e.g., when executing
6748 // FileChangedShell autocmd) 6750 // FileChangedShell autocmd)
6749 if (stat_res < 0) 6751 if (stat_res < 0)
6817 return 2; 6819 return 2;
6818 } 6820 }
6819 if (!n) 6821 if (!n)
6820 { 6822 {
6821 if (*reason == 'd') 6823 if (*reason == 'd')
6822 mesg = _("E211: File \"%s\" no longer available"); 6824 {
6825 // Only give the message once.
6826 if (prev_b_mtime != -1)
6827 mesg = _("E211: File \"%s\" no longer available");
6828 }
6823 else 6829 else
6824 { 6830 {
6825 helpmesg = TRUE; 6831 helpmesg = TRUE;
6826 #if defined(FEAT_CON_DIALOG) || defined(FEAT_GUI_DIALOG) 6832 #if defined(FEAT_CON_DIALOG) || defined(FEAT_GUI_DIALOG)
6827 can_reload = TRUE; 6833 can_reload = TRUE;