Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vim(call):E697: List lacks of ending character ']' using example config. #53

Closed
AllenDang opened this issue Aug 1, 2021 · 5 comments
Closed
Labels
bug Something isn't working lua neovim

Comments

@AllenDang
Copy link

AllenDang commented Aug 1, 2021

Here is my config, I'm using Neovim 0.5 with Packer.

  {
    "gelguy/wilder.nvim",
    requires = "nixprime/cpsm",
    config = function()
      vim.cmd([[
call wilder#enable_cmdline_enter()
set wildcharm=<Tab>
cmap <expr> <Tab> wilder#in_context() ? wilder#next() : "\<Tab>"
cmap <expr> <S-Tab> wilder#in_context() ? wilder#previous() : "\<S-Tab>"
call wilder#set_option('modes', ['/', '?', ':'])

call wilder#set_option('pipeline', [
      \   wilder#branch(
      \     wilder#python_file_finder_pipeline({
      \       'file_command': {_, arg -> stridx(arg, '.') != -1 ? ['fd', '-tf', '-H'] : ['fd', '-tf']},
      \       'dir_command': ['fdfind', '-td'],
      \       'filters': ['cpsm_filter'],
      \       'cache_timestamp': {-> 1},
      \     }),
      \     wilder#cmdline_pipeline({
      \       'fuzzy': 1,
      \       'fuzzy_filter': wilder#python_cpsm_filter(),
      \       'set_pcre2_pattern': 0,
      \     }),
      \     wilder#python_search_pipeline({
      \       'pattern': wilder#python_fuzzy_pattern({
      \         'start_at_boundary': 0,
      \       }),
      \     }),
      \   ),
      \ ])

let g:highlighters = [
      \ wilder#pcre2_highlighter(),
      \ wilder#lua_fzy_highlighter(),
      \ ]

call wilder#set_option('renderer', wilder#renderer_mux({
      \ ':': wilder#popupmenu_renderer({
      \   'highlighter': g:highlighters,
      \   'left': [
      \     wilder#popupmenu_devicons(),
      \   ],
      \   'right': [
      \     ' ',
      \     wilder#popupmenu_scrollbar(),
      \   ],
      \ }),
      \ '/': wilder#wildmenu_renderer({
      \   'highlighter': g:highlighters,
      \ }),
      \ }))
      ]])
    end,
  }
@gelguy
Copy link
Owner

gelguy commented Aug 1, 2021

I don't use packer but I'm not able to reproduce this using init.lua.

This is the 2nd report (see #52 (comment)) so there seems to be something going wrong. Is it possible to remove lines to debug which section is causing the issue?

@AllenDang
Copy link
Author

AllenDang commented Aug 1, 2021

@gelguy You don't have to use packer to repo this issue. Just create a lua file with below content and do :luafile %.

vim.cmd([[
call wilder#enable_cmdline_enter()
set wildcharm=<Tab>
cmap <expr> <Tab> wilder#in_context() ? wilder#next() : "\<Tab>"
cmap <expr> <S-Tab> wilder#in_context() ? wilder#previous() : "\<S-Tab>"
call wilder#set_option('modes', ['/', '?', ':'])

call wilder#set_option('pipeline', [
      \   wilder#branch(
      \     wilder#python_file_finder_pipeline({
      \       'file_command': {_, arg -> stridx(arg, '.') != -1 ? ['fd', '-tf', '-H'] : ['fd', '-tf']},
      \       'dir_command': ['fdfind', '-td'],
      \       'filters': ['cpsm_filter'],
      \       'cache_timestamp': {-> 1},
      \     }),
      \     wilder#cmdline_pipeline({
      \       'fuzzy': 1,
      \       'fuzzy_filter': wilder#python_cpsm_filter(),
      \       'set_pcre2_pattern': 0,
      \     }),
      \     wilder#python_search_pipeline({
      \       'pattern': wilder#python_fuzzy_pattern({
      \         'start_at_boundary': 0,
      \       }),
      \     }),
      \   ),
      \ ])

let g:highlighters = [
      \ wilder#pcre2_highlighter(),
      \ wilder#lua_fzy_highlighter(),
      \ ]

call wilder#set_option('renderer', wilder#renderer_mux({
      \ ':': wilder#popupmenu_renderer({
      \   'highlighter': g:highlighters,
      \   'left': [
      \     wilder#popupmenu_devicons(),
      \   ],
      \   'right': [
      \     ' ',
      \     wilder#popupmenu_scrollbar(),
      \   ],
      \ }),
      \ '/': wilder#wildmenu_renderer({
      \   'highlighter': g:highlighters,
      \ }),
      \ }))
]])

@gelguy
Copy link
Owner

gelguy commented Aug 1, 2021

Thanks for the config. I can reproduce it now.

Looks like this is a Neovim bug (see neovim/neovim#14809). The workaround would be to combine all the \ lines into one long line but that is not ideal.

@gelguy gelguy added lua bug Something isn't working labels Aug 1, 2021
@brunuh
Copy link

brunuh commented Aug 5, 2021

A possible workaround for this could be to have the wilder.nvim config in a vim file and have the packer config like this:

config = function()
      vim.cmd([[
          source vim/file/location/wild.vim
      ]])

@gelguy gelguy added the neovim label Aug 6, 2021
@gelguy
Copy link
Owner

gelguy commented Apr 26, 2022

Configuration in pure Lua is now fully supported. Examples can be found in the README page.

Closing this issue since it is no longer necessary to call vim.cmd.

@gelguy gelguy closed this as completed Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lua neovim
Projects
None yet
Development

No branches or pull requests

3 participants