Comments (6)
I've updated the behavior in #25.
The plugin will fallback to Vim's inbuilt wildmenu
if an error is encountered when doing a custom completion for a user command.
from wilder.nvim.
Thanks for the bug report!
I've investigated and the root cause is there is a missing filter step for custom
command completions. I wrongly assumed it was similar to customlist
which did not require filtering.
I don't have access to my development environment so I won't be able to fix this immediately. For a workaround, you can try adding this config:
function! FilterCocList(ctx, res) abort
let l:parsed = wilder#cmdline#parse(a:ctx.input)
if l:parsed.cmd !=# 'CocList' " other commands can be added here
return a:res
endif
let l:arg = l:parsed.cmdline[l:parsed.pos :]
return extend(a:res, {
\ 'value': filter(a:res.value, {i, x -> match(x, l:arg) != -1}),
\ 'data': extend(get(a:res, 'data', {}), {'query': l:arg})
\ })
call wilder#set_option('pipeline', wilder#branch(
\ wilder#python_search_pipeline(),
\ wilder#cmdline_pipeline() + [funcref('FilterCocList')]
\ )
endfunction
from wilder.nvim.
Thank you for your replay.
It worked in your config!! I appreciate it very much.
function! FilterCocList(ctx, res) abort
let l:parsed = wilder#cmdline#parse(a:ctx.input)
if l:parsed.cmd ==# 'CocList'
let l:arg = l:parsed.cmdline[l:parsed.pos :]
return extend(a:res, {
\ 'value': filter(a:res.value, {i, x -> match(x, l:arg) != -1}),
\ 'data': extend(get(a:res, 'data', {}), {'query': l:arg})
\ })
endif
return a:res
endfunction
call wilder#set_option('pipeline', wilder#branch(
\ wilder#python_search_pipeline(),
\ wilder#cmdline_pipeline() + [funcref('FilterCocList')]
\ ))
from wilder.nvim.
But I found a new issue.
CocCommand
does not work. Because it uses a script local function for completion.
https://github.com/neoclide/coc.nvim/blob/bdd9a9e1401fe6fdd57a9bd078e3651ecf1e0202/plugin/coc.vim#L415
This is the error message.
pipeline: Vim(let):E700: Unknown function: s:CommandList
Is there a solution?
from wilder.nvim.
There's a quick workaround for this by redefining the command:
function! CommandList(...) abort
let list = coc#rpc#request('commandList', a:000)
return join(list, "\n")
endfunction
command! -nargs=* -complete=custom,CommandList -range CocCommand :call coc#rpc#notify('runCommand', [<f-args>])
from wilder.nvim.
So that's the only way to override it. This is a pain with a lot of commands.
But thank you. I will continue to use this plugin.
from wilder.nvim.
Related Issues (20)
- Relative to `pwd` path
- Wilder slow on `:!` HOT 1
- File finder: customizable behavior on should_use_file_finder HOT 1
- Changing the background color HOT 1
- Strange off-by-one error when hitting <Tab> in the command line HOT 3
- `_wilder_python_search` error when searching with `/` HOT 2
- Highlight the candidates
- Wilder removes topline in buffer in .10 nightly
- Wilder pop up breaks lualine "diff" component
- The popup menu's color is weird HOT 1
- I entered / in cmdline and received this error HOT 6
- Issue with wilder when trying to select commands(TAB) HOT 1
- Trying to install wilder correctly for NvChad, getting Unknown function _wilder_python_file_finder HOT 1
- Semshi/Wilder conflict HOT 6
- Configure to operate similarly to wildmode=list:longest?
- "error caught in async handler" when searching HOT 1
- Popupmenu_render only works on 1st table.
- Bug when trying to save harpoon buffer
- How to select the first listed item by default? HOT 5
- Unknown function: _wilder_python_search HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wilder.nvim.