]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(sqlcomplete): only set 'omnifunc' if dbext plugin was loaded
authorChristian Brabandt <cb@256bit.org>
Tue, 11 Nov 2025 17:13:44 +0000 (17:13 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 11 Nov 2025 17:13:44 +0000 (17:13 +0000)
fixes: #18716

Co-authored-by: gcanat <72149218+gcanat@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/sqlcomplete.vim

index adbdbab894c2d3970e7bd9d2f1b7869e6a738a4c..4017ae9b058ca353736d18ac11061aecf96ce17e 100644 (file)
@@ -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"
 " 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')