bug.vimfiletype plugin indent on syntax on set wildoptions+=fuzzy set completeopt=menu,noselect,longest
vim -u bug.vim example.vimset co and then press <C-x><C-o> to use omni completionco is deletedSince longest is in &completeopt, the omni completion should just show me the options starting with the prefix (e.g. co) but with set wildoptions+=fuzzy (which should only affect command-line completion) the completion is fuzzy and the common prefix is removed.
9.2.1122
Not needed
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
The reverse is also true: If 'completeopt' contains "fuzzy" but 'wildoptions' doesn't, the omnifunc completion still isn't fuzzy.
However :h ft-vim-omni does say "fallback to command line completion" and isn't really clear about which "fuzzy" flag should apply to it...
cc @habamax
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
vim's omnifunc uses getcompletion() to get items, e.g:
if empty(items) && !empty(base)
items = getcompletion(base, 'expression')
->mapnew((_, v) => ({word: v, kind: 'v', menu: 'Expression', dup: 0}))
endif
And the it's help topics states following:
If the 'wildoptions' option contains 'fuzzy', then fuzzy
matching is used to get the completion matches. Otherwise
regular expression matching is used. Thus this function
follows the user preference, what happens on the command line.
If you do not want this you can make 'wildoptions' empty
before calling getcompletion() and restore it afterwards.
I can set/reset wildoptions in the omnifunc, but not sure of the side effects.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
basically this:
# -----added------
var save_wildoptions = &wildoptions
&wildoptions = ""
defer () => {
&wildoptions = save_wildoptions
}()
# -----added------
var items = []
if trigger == 'function'
items = getcompletion(base, 'function')
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
this "works" but still the function still returns:
set wildoptions=
echo getcompletion('col', 'option')
# ['colorcolumn', 'columns', 'conceallevel']
Image: Image (view on web)
Image: Image (view on web)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
The reverse is also true: If 'completeopt' contains "fuzzy" but 'wildoptions' doesn't, the omnifunc completion still isn't fuzzy.
I'm not able to reproduce this, set completeopt+=fuzzy works as expected even with an empty &wildoptions.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@habamax What about all the other omnifuncs that use getcompletion()?
I initially noticed this behavior using the omnifunc from yegappan/lsp but that was actually another problem in which the fuzzy completion was happening server-side. I then tested vim's omnifunc and, apparently by accident, it had the same problem which I was able to attribute to &wildoptions.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
What other omnifuncs?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@habamax What about all the other omnifuncs that use
getcompletion()?
I am not aware of other omnifuncs that use getcompletion(). Vim's omnicomple uses it to complete vimscript, I am not sure if other filetypes would benefit from it.
I initially noticed this behavior using the omnifunc from yegappan/lsp but that was actually another problem in which the fuzzy completion was happening server-side. I then tested vim's omnifunc and, apparently by accident, it had the same problem which I was able to attribute to &wildoptions.
That is probably a different issue then and it needs reproducible steps.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()