Patch 9.0.0789
Problem:    Dummy buffer ends up in a window.
Solution:   Disallow navigating to a dummy buffer.
Files:      src/buffer.c, src/testdir/test_autocmd.vim


*** ../vim-9.0.0788/src/buffer.c        2022-10-15 16:04:43.994187227 +0100
--- src/buffer.c        2022-10-18 17:03:57.283137177 +0100
***************
*** 1351,1356 ****
--- 1351,1363 ----
      if ((flags & DOBUF_NOPOPUP) && bt_popup(buf) && !bt_terminal(buf))
        return OK;
  #endif
+     if ((action == DOBUF_GOTO || action == DOBUF_SPLIT)
+                                                 && (buf->b_flags & BF_DUMMY))
+     {
+       // disallow navigating to the dummy buffer
+       semsg(_(e_buffer_nr_does_not_exist), count);
+       return FAIL;
+     }
  
  #ifdef FEAT_GUI
      need_mouse_correct = TRUE;
*** ../vim-9.0.0788/src/testdir/test_autocmd.vim        2022-10-18 
15:10:07.541220976 +0100
--- src/testdir/test_autocmd.vim        2022-10-18 17:02:42.122865146 +0100
***************
*** 3857,3860 ****
--- 3857,3880 ----
    call assert_true(autocmd_delete([test_null_dict()]))
  endfunc
  
+ func Test_autocmd_split_dummy()
+   " Autocommand trying to split a window containing a dummy buffer.
+   auto BufReadPre * exe "sbuf " .. expand("<abuf>") 
+   " Avoid the "W11" prompt
+   au FileChangedShell * let v:fcs_choice = 'reload'
+   func Xautocmd_changelist()
+     cal writefile(['Xtestfile2:4:4'], 'Xerr')
+     edit Xerr
+     lex 'Xtestfile2:4:4'
+   endfunc
+   call Xautocmd_changelist()
+   call assert_fails('call Xautocmd_changelist()', 'E86:')
+ 
+   au! BufReadPre
+   au! FileChangedShell
+   delfunc Xautocmd_changelist
+   bwipe! Xerr
+   call delete('Xerr')
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-9.0.0788/src/version.c       2022-10-18 15:10:07.541220976 +0100
--- src/version.c       2022-10-18 17:04:20.951485418 +0100
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     789,
  /**/

-- 
SIGIRO -- irony detected (iron core dumped)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221018160625.5A1EA1C0EE2%40moolenaar.net.

Raspunde prin e-mail lui