Skip to content

Commit b74ec15

Browse files
chrisbragcanat
andcommitted
runtime(sqlcomplete): only set 'omnifunc' if dbext plugin was loaded
fixes: #18716 Co-authored-by: gcanat <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 97c3744 commit b74ec15

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

runtime/autoload/sqlcomplete.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
44
" Version: 16.0
55
" Last Change: 2017 Oct 15
6+
" 2025 Nov 11 by Vim project: only set 'omnifunc' if dbext script was loaded #18716
67
" Homepage: http://www.vim.org/scripts/script.php?script_id=1572
78
" Usage: For detailed help
89
" ":help sql.txt"
@@ -98,12 +99,11 @@
9899
" Set completion with CTRL-X CTRL-O to autoloaded function.
99100
" This check is in place in case this script is
100101
" sourced directly instead of using the autoload feature.
101-
if exists('&omnifunc')
102-
" Do not set the option if already set since this
103-
" results in an E117 warning.
104-
if &omnifunc == ""
105-
setlocal omnifunc=sqlcomplete#Complete
106-
endif
102+
"
103+
" Do not set the option if already set since this
104+
" results in an E117 warning.
105+
if exists('&omnifunc') && &omnifunc == "" && exists('g:loaded_dbext')
106+
setlocal omnifunc=sqlcomplete#Complete
107107
endif
108108

109109
if exists('g:loaded_sql_completion')

0 commit comments

Comments
 (0)