runtime(sqlcomplete): only set 'omnifunc' if dbext plugin was loaded

Commit: 
https://github.com/vim/vim/commit/b74ec159ddae8dac0f1a2f3777392336de08e0c5
Author: Christian Brabandt <[email protected]>
Date:   Tue Nov 11 17:13:44 2025 +0000

    runtime(sqlcomplete): only set 'omnifunc' if dbext plugin was loaded
    
    fixes: https://github.com/vim/vim/issues/18716
    
    Co-authored-by: gcanat <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/autoload/sqlcomplete.vim b/runtime/autoload/sqlcomplete.vim
index adbdbab89..4017ae9b0 100644
--- a/runtime/autoload/sqlcomplete.vim
+++ b/runtime/autoload/sqlcomplete.vim
@@ -3,6 +3,7 @@
 " Maintainer:  David Fishburn <dfishburn dot vim at gmail dot com>
 " Version:     16.0
 " Last Change: 2017 Oct 15
+" 2025 Nov 11 by Vim project: only set 'omnifunc' if dbext script was loaded 
#18716
 " Homepage:    http://www.vim.org/scripts/script.php?script_id=1572
 " Usage:       For detailed help
 "              ":help sql.txt"
@@ -98,12 +99,11 @@
 " Set completion with CTRL-X CTRL-O to autoloaded function.
 " This check is in place in case this script is
 " sourced directly instead of using the autoload feature.
-if exists('&omnifunc')
-    " Do not set the option if already set since this
-    " results in an E117 warning.
-    if &omnifunc == ""
-        setlocal omnifunc=sqlcomplete#Complete
-    endif
+"
+" Do not set the option if already set since this
+" results in an E117 warning.
+if exists('&omnifunc') && &omnifunc == "" && exists('g:loaded_dbext')
+    setlocal omnifunc=sqlcomplete#Complete
 endif
 
 if exists('g:loaded_sql_completion')

-- 
-- 
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 visit 
https://groups.google.com/d/msgid/vim_dev/E1vJWPH-001DKE-UW%40256bit.org.

Raspunde prin e-mail lui