runtime(optwin): Fix E94 when searching for the option-window

Commit: 
https://github.com/vim/vim/commit/3be4ad76df92086e29c3fcf5e6a25f285b6e188f
Author: RestorerZ <resto...@mail2k.ru>
Date:   Fri Aug 8 12:37:06 2025 +0200

    runtime(optwin): Fix E94 when searching for the option-window
    
    Problem:  When the parameter debug=msg is set and the command :option is
              entered, error E94 will be displayed.
    Solution: Add a check for the existence of the buffer before getting the
              buffer number “option-window”.
    
    Reproduce:
    
    vim --clean -c "set debug=msg" -c "option"
    
        Error detected while processing command line..script D:\Programs\Vim 
im91\optwin.vim:
        line 9: E94: No matching buffer for option-window
    
    closes: #17927
    
    Signed-off-by: RestorerZ <resto...@mail2k.ru>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index 47e165f45..26c80e5ce 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -1,11 +1,11 @@
 " These commands create the option window.
 "
 " Maintainer:  The Vim Project <https://github.com/vim/vim>
-" Last Change: 2025 Jul 25
+" Last Change: 2025 Aug 07
 " Former Maintainer:   Bram Moolenaar <b...@vim.org>
 
 " If there already is an option window, jump to that one.
-let buf = bufnr('option-window')
+let buf = bufexists('option-window') ? bufnr('option-window') : -1
 if buf >= 0
   let winids = win_findbuf(buf)
   if len(winids) > 0

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1ukKax-002Grd-A6%40256bit.org.

Raspunde prin e-mail lui