]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(optwin): Fix E94 when searching for the option-window
authorRestorerZ <restorer@mail2k.ru>
Fri, 8 Aug 2025 10:37:06 +0000 (12:37 +0200)
committerChristian Brabandt <cb@256bit.org>
Fri, 8 Aug 2025 10:38:33 +0000 (12:38 +0200)
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\vim91\optwin.vim:
    line 9: E94: No matching buffer for option-window

closes: #17927

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/optwin.vim

index 47e165f4551a777501f2394ea4f8130452e14e4b..26c80e5ce0eb5082b909bb0e5e3a8ec26dbc0691 100644 (file)
@@ -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 <Bram@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