]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0154: shm=F not respected when reloading buffer with 'autoread' v9.1.0154
authorShougo Matsushita <Shougo.Matsu@gmail.com>
Wed, 6 Mar 2024 19:58:41 +0000 (20:58 +0100)
committerChristian Brabandt <cb@256bit.org>
Wed, 6 Mar 2024 19:58:41 +0000 (20:58 +0100)
Problem:  shm=F not respected when reloading buffer with 'autoread'
Solution: Check SHM_FILEINFO in buf_check_timestamp()
          (Shougo Matsushita)

closes: #14144

Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/options.txt
src/fileio.c
src/testdir/test_options.vim
src/version.c

index e38aa81a808c4ba57df2409d7ada1e9934094a23..9af7411d988a52892336705493dedf3c89e2edd6 100644 (file)
@@ -1,4 +1,4 @@
-*options.txt*  For Vim version 9.1.  Last change: 2024 Mar 03
+*options.txt*  For Vim version 9.1.  Last change: 2024 Mar 06
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -7253,7 +7253,7 @@ A jump table for the options with a short description can be found at |Q_op|.
          q     use "recording" instead of "recording @a"               *shm-q*
          F     don't give the file info when editing a file, like      *shm-F*
                `:silent` was used for the command; note that this also
-               affects messages from autocommands
+               affects messages from autocommands and 'autoread' reloading
          S     do not show search count message when searching, e.g.   *shm-S*
                "[1/5]"
 
index d293d713d3610d7c3c758cacebfa6985ab7bae6f..344c819e7e89c952abf921267a9557c1b875471c 100644 (file)
@@ -4294,7 +4294,7 @@ buf_check_timestamp(
 #endif
     }
 
-    if (mesg != NULL)
+    if (mesg != NULL && !shortmess(SHM_FILEINFO))
     {
        path = home_replace_save(buf, buf->b_fname);
        if (path != NULL)
index 908f0da1247742456fd044c5f31b3e32aea0f76f..fa65f5c192e9f312690a2bdc206449c2e7574f64 100644 (file)
@@ -1293,6 +1293,26 @@ func Test_shortmess_F2()
   call assert_fails('call test_getvalue("abc")', 'E475:')
 endfunc
 
+func Test_shortmess_F3()
+  defer delete('X_dummy')
+
+  set hidden
+  set autoread
+  e X_dummy
+  e file
+
+  set shortmess+=F
+  call writefile(["foo"], 'X_dummy')
+  call assert_true(empty(execute('bn', '')))
+  call assert_true(empty(execute('bn', '')))
+
+  set shortmess&
+  set autoread&
+  set hidden&
+  bwipe
+  bwipe
+endfunc
+
 func Test_local_scrolloff()
   set so=5
   set siso=7
index 8ada6585d58cd7867921d3c687610bfe8440f0fa..0e02ea2aad8501329f71167cc5da3e1e9527dacc 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    154,
 /**/
     153,
 /**/