gelguy / wilder.nvim

A more adventurous wildmenu
MIT License
1.33k stars 34 forks source link

File completion slows down when given single quotes #100

Closed notpeelz closed 2 years ago

notpeelz commented 2 years ago

Neovim version:

NVIM v0.6.0-dev+479-g9086938f7
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-11 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az50-41

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/home/runner/work/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info

:checkhealth:

``` coc: health#coc#check ======================================================================== - OK: Environment check passed - OK: Javascript bundle build/index.js found - OK: Service started coc_fzf: health#coc_fzf#check ======================================================================== ## ctags (optional) - WARNING: ctags not found, outline won't work if symbols are not supported - ADVICE: - git clone https://github.com/universal-ctags/ctags.git - cd ctags - ./autogen.sh - ./configure - make - sudo make install ## fzf.vim (optional) - OK: fzf.vim found nvim: health#nvim#check ======================================================================== ## Configuration - OK: no issues found ## Performance - OK: Build type: RelWithDebInfo ## Remote Plugins - OK: Up to date ## terminal - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177 - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~ - INFO: $SSH_TTY='/dev/pts/0' ## tmux - OK: escape-time: 0 - INFO: Checking stuff - OK: focus-events: on - INFO: $TERM: screen-256color - WARNING: Neither Tc nor RGB capability set. True colors are disabled. |'termguicolors'| won't work properly. - ADVICE: - Put this in your ~/.tmux.conf and replace XXX by your $TERM outside of tmux: set-option -sa terminal-overrides ',XXX:RGB' - For older tmux versions use this instead: set-option -ga terminal-overrides ',XXX:Tc' nvim-treesitter: require("nvim-treesitter.health").check() ======================================================================== ## Installation - WARNING: `tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall) - OK: `node` found v16.10.0 (only needed for :TSInstallFromGrammar) - OK: `git` executable found. - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" } Version: cc (Debian 8.3.0-6) 8.3.0 - OK: Neovim was compiled with tree-sitter runtime ABI version 13 (required >=13). Parsers must be compatible with runtime ABI. ## Parser/Features H L F I J - css ✓ . ✓ ✓ ✓ - javascript ✓ ✓ ✓ ✓ ✓ - scss ✓ . . ✓ . - comment ✓ . . . . - dockerfile ✓ . . . ✓ - haskell ✓ . . . ✓ - hcl ✓ . ✓ ✓ ✓ - clojure ✓ ✓ ✓ . ✓ - json ✓ ✓ ✓ ✓ . - commonlisp ✓ ✓ ✓ . . - go ✓ ✓ ✓ ✓ ✓ - toml ✓ ✓ ✓ ✓ ✓ - bash ✓ ✓ ✓ . ✓ - cuda ✓ ✓ ✓ ✓ ✓ - tsx ✓ ✓ ✓ ✓ ✓ - jsonc ✓ ✓ ✓ ✓ ✓ - html ✓ ✓ ✓ ✓ ✓ - yang ✓ . ✓ . . - vue ✓ . ✓ . ✓ - dot ✓ . . . ✓ - elm . . . . . - rst ✓ ✓ . . ✓ - java ✓ ✓ . ✓ ✓ - fennel ✓ ✓ . . ✓ - regex ✓ . . . . - yaml ✓ ✓ ✓ ✓ ✓ - ql ✓ ✓ . ✓ ✓ - gomod ✓ . . . . - graphql ✓ . . ✓ ✓ - ruby ✓ ✓ ✓ ✓ ✓ - fish ✓ ✓ ✓ ✓ ✓ - jsdoc ✓ . . . . - sparql ✓ ✓ ✓ ✓ ✓ - c ✓ ✓ ✓ ✓ ✓ - zig ✓ . ✓ ✓ ✓ - kotlin ✓ . . . ✓ - turtle ✓ ✓ ✓ ✓ ✓ - c_sharp ✓ ✓ ✓ . ✓ - query ✓ ✓ ✓ ✓ ✓ - supercollider ✓ ✓ ✓ ✓ ✓ - python ✓ ✓ ✓ ✓ ✓ - elixir ✓ ✓ ✓ ✓ ✓ - erlang . . . . . - scala ✓ . ✓ . ✓ - heex ✓ . ✓ ✓ ✓ - rust ✓ ✓ ✓ ✓ ✓ - beancount ✓ . ✓ . . - surface ✓ . ✓ ✓ ✓ - vim ✓ ✓ . . ✓ - latex ✓ . ✓ . ✓ - cmake ✓ . ✓ . . - fortran ✓ . ✓ ✓ . - nix ✓ ✓ ✓ . ✓ - ledger ✓ . ✓ ✓ ✓ - bibtex ✓ . ✓ ✓ . - svelte ✓ . ✓ ✓ ✓ - ocaml_interface✓ ✓ ✓ . ✓ - php ✓ ✓ ✓ ✓ ✓ - perl ✓ . . . . - r ✓ ✓ . . . - glsl ✓ ✓ ✓ ✓ ✓ - julia ✓ ✓ ✓ ✓ ✓ - json5 ✓ . . . ✓ - ocaml ✓ ✓ ✓ . ✓ - pioasm ✓ . . . ✓ - cpp ✓ ✓ ✓ ✓ ✓ - hjson ✓ ✓ ✓ ✓ ✓ - tlaplus ✓ . ✓ . ✓ - glimmer ✓ . . . . - llvm ✓ . . . . - typescript ✓ ✓ ✓ ✓ ✓ - dart ✓ ✓ . ✓ ✓ - lua ✓ ✓ ✓ ✓ ✓ - verilog ✓ ✓ ✓ . ✓ Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections +) multiple parsers found, only one will be used x) errors found in the query, try to run :TSUpdate {lang} provider: health#provider#check ======================================================================== ## Clipboard (optional) - OK: Clipboard tool found: tmux ## Python 2 provider (optional) - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics. - ERROR: Python provider error: - ADVICE: - provider/pythonx: Could not load Python 2: /usr/bin/python2 does not have the "neovim" module. :help |provider-python| /usr/bin/python2.7 does not have the "neovim" module. :help |provider-python| python2.6 not found in search path or not executable. /usr/bin/python does not have the "neovim" module. :help |provider-python| - INFO: Executable: Not found ## Python 3 provider (optional) - INFO: `g:python3_host_prog` is not set. Searching for python3 in the environment. - INFO: Multiple python3 executables found. Set `g:python3_host_prog` to avoid surprises. - INFO: Executable: /usr/bin/python3 - INFO: Other python executable: /bin/python3 - INFO: Python version: 3.7.3 - INFO: pynvim version: 0.4.3 - OK: Latest pynvim is installed. ## Python virtualenv - OK: no $VIRTUAL_ENV ## Ruby provider (optional) - WARNING: `ruby` and `gem` must be in $PATH. - ADVICE: - Install Ruby and verify that `ruby` and `gem` commands work. ## Node.js provider (optional) - INFO: Node.js: v16.10.0 - INFO: Nvim node.js host: /home/peelz/.nvm/versions/node/v16.10.0/lib/node_modules/neovim/bin/cli.js - OK: Latest "neovim" npm/yarn package is installed: 4.10.0 ## Perl provider (optional) - ERROR: perl provider error: - ADVICE: - "Neovim::Ext" cpan module is not installed vim.lsp: require("vim.lsp.health").check() ======================================================================== - INFO: LSP log level : WARN - INFO: Log path: /home/peelz/.cache/nvim/lsp.log - INFO: Log size: 75 KB vim.treesitter: require("vim.treesitter.health").check() ======================================================================== - INFO: Runtime ABI version : 13 - OK: Loaded parser for bash: ABI version 13 - OK: Loaded parser for beancount: ABI version 13 - OK: Loaded parser for bibtex: ABI version 13 - OK: Loaded parser for c: ABI version 13 - OK: Loaded parser for c_sharp: ABI version 13 - OK: Loaded parser for clojure: ABI version 13 - OK: Loaded parser for cmake: ABI version 13 - OK: Loaded parser for comment: ABI version 13 - OK: Loaded parser for commonlisp: ABI version 13 - OK: Loaded parser for cpp: ABI version 13 - OK: Loaded parser for css: ABI version 13 - OK: Loaded parser for cuda: ABI version 13 - OK: Loaded parser for dart: ABI version 13 - OK: Loaded parser for dockerfile: ABI version 13 - OK: Loaded parser for dot: ABI version 13 - OK: Loaded parser for elixir: ABI version 13 - OK: Loaded parser for elm: ABI version 13 - OK: Loaded parser for erlang: ABI version 13 - OK: Loaded parser for fennel: ABI version 13 - OK: Loaded parser for fish: ABI version 13 - OK: Loaded parser for fortran: ABI version 13 - OK: Loaded parser for glimmer: ABI version 13 - OK: Loaded parser for glsl: ABI version 13 - OK: Loaded parser for go: ABI version 13 - OK: Loaded parser for gomod: ABI version 13 - OK: Loaded parser for graphql: ABI version 13 - OK: Loaded parser for haskell: ABI version 13 - OK: Loaded parser for hcl: ABI version 13 - OK: Loaded parser for heex: ABI version 13 - OK: Loaded parser for hjson: ABI version 13 - OK: Loaded parser for html: ABI version 13 - OK: Loaded parser for java: ABI version 13 - OK: Loaded parser for javascript: ABI version 13 - OK: Loaded parser for jsdoc: ABI version 13 - OK: Loaded parser for json: ABI version 13 - OK: Loaded parser for json5: ABI version 13 - OK: Loaded parser for jsonc: ABI version 13 - OK: Loaded parser for julia: ABI version 13 - OK: Loaded parser for kotlin: ABI version 13 - OK: Loaded parser for latex: ABI version 13 - OK: Loaded parser for ledger: ABI version 13 - OK: Loaded parser for llvm: ABI version 13 - OK: Loaded parser for lua: ABI version 13 - OK: Loaded parser for nix: ABI version 13 - OK: Loaded parser for ocaml: ABI version 13 - OK: Loaded parser for ocaml_interface: ABI version 13 - OK: Loaded parser for perl: ABI version 13 - OK: Loaded parser for php: ABI version 13 - OK: Loaded parser for pioasm: ABI version 13 - OK: Loaded parser for python: ABI version 13 - OK: Loaded parser for ql: ABI version 13 - OK: Loaded parser for query: ABI version 13 - OK: Loaded parser for r: ABI version 13 - OK: Loaded parser for regex: ABI version 13 - OK: Loaded parser for rst: ABI version 13 - OK: Loaded parser for ruby: ABI version 13 - OK: Loaded parser for rust: ABI version 13 - OK: Loaded parser for scala: ABI version 13 - OK: Loaded parser for scss: ABI version 13 - OK: Loaded parser for sparql: ABI version 13 - OK: Loaded parser for supercollider: ABI version 13 - OK: Loaded parser for surface: ABI version 13 - OK: Loaded parser for svelte: ABI version 13 - OK: Loaded parser for tlaplus: ABI version 13 - OK: Loaded parser for toml: ABI version 13 - OK: Loaded parser for tsx: ABI version 13 - OK: Loaded parser for turtle: ABI version 13 - OK: Loaded parser for typescript: ABI version 13 - OK: Loaded parser for verilog: ABI version 13 - OK: Loaded parser for vim: ABI version 13 - OK: Loaded parser for vue: ABI version 13 - OK: Loaded parser for yaml: ABI version 13 - OK: Loaded parser for yang: ABI version 13 - OK: Loaded parser for zig: ABI version 13 - OK: Loaded parser for c: ABI version 13 ```

Minimal vimrc:

```vim " vim:foldmethod=marker " Compatibility {{{ scriptencoding utf-8 set nocompatible set encoding=utf-8 set timeoutlen=1000 set ttimeoutlen=0 let g:is_unix = has('unix') if g:is_unix " Download vim-plug if not already installed {{{ if has('nvim') if !filereadable(expand('~/.local/share/nvim/site/autoload/plug.vim')) silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim autocmd VimEnter * PlugInstall | source $MYVIMRC endif else if !filereadable(expand('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim autocmd VimEnter * PlugInstall | source $MYVIMRC endif endif else if !filereadable(expand('~/vimfiles/autoload/plug.vim')) echom "Install vim-plug!" endif endif " }}} " Plugins {{{ call plug#begin('~/.vim/plugged') Plug 'gelguy/wilder.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'romgrk/fzy-lua-native' " Requires cmake, libboost-all-dev, python-dev and libicu-dev " FIXME: install.sh exits with exitcode 1 Plug 'nixprime/cpsm', { 'do': './install.sh' } Plug 'kyazdani42/nvim-web-devicons' call plug#end() " }}} " wilder {{{ fun! s:WilderInit() call wilder#setup({ \ 'modes': [':', '/', '?'], \ 'next_key': '', \ 'previous_key': '', \ 'accept_key': '', \ 'reject_key': '', \ }) let s:scale = [ \ '#f4468f', '#fd4a85', '#ff507a', '#ff566f', '#ff5e63', \ '#ff6658', '#ff704e', '#ff7a45', '#ff843d', '#ff9036', \ '#f89b31', '#efa72f', '#e6b32e', '#dcbe30', '#d2c934', \ '#c8d43a', '#bfde43', '#b6e84e', '#aff05b', \ ] let s:gradient = map(s:scale, {i, fg -> wilder#make_hl( \ 'WilderGradient' . i, 'Pmenu', [{}, {}, {'foreground': fg}] \ )}) let s:highlighters = wilder#highlighter_with_gradient([ \ wilder#pcre2_highlighter(), \ wilder#basic_highlighter(), \ ]) let s:popupmenu_renderer = wilder#popupmenu_renderer(wilder#popupmenu_border_theme({ \ 'border': 'rounded', \ 'empty_message': wilder#popupmenu_empty_message_with_spinner(), \ 'highlights': { \ 'gradient': s:gradient, \ }, \ 'highlighter': s:highlighters, \ 'left': [ \ ' ', \ wilder#popupmenu_devicons({ \ 'get_icon': wilder#devicons_get_icon_from_nvim_web_devicons(), \ 'get_hl': wilder#devicons_get_hl_from_nvim_web_devicons(), \ }), \ wilder#popupmenu_buffer_flags({ \ 'flags': ' a + ', \ 'icons': {'+': '', 'a': '', 'h': ''}, \ }), \ ], \ 'right': [ \ ' ', \ wilder#popupmenu_scrollbar(), \ ], \ })) 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': ['fd', '-td'], \ 'filters': ['cpsm_filter'], \ }), \ wilder#cmdline_pipeline({ \ 'fuzzy': 1, \ 'fuzzy_filter': wilder#lua_fzy_filter(), \ 'hide_in_substitute': 1, \ }), \ [ \ wilder#check({_, x -> empty(x)}), \ wilder#history(), \ ], \ wilder#python_search_pipeline({ \ 'pattern': wilder#python_fuzzy_pattern({ \ 'start_at_boundary': 0, \ }), \ }), \ ), \ ]) let s:wildmenu_renderer = wilder#wildmenu_renderer({ \ 'highlighter': s:highlighters, \ 'separator': ' · ', \ 'left': [' ', wilder#wildmenu_spinner(), ' '], \ 'right': [' ', wilder#wildmenu_index()], \ }) call wilder#set_option('renderer', wilder#renderer_mux({ \ ':': s:popupmenu_renderer, \ '/': s:wildmenu_renderer, \ })) endfun augroup vimrc_WilderConfig autocmd! autocmd CmdLineEnter * ++once call WilderInit() augroup END " }}} ```

Steps to reproduce:

  1. Launch neovim with the provided vimrc: nvim -u vim_config
  2. Type :w !curl -F' or :e '

At this point the command line should feel noticeably unresponsive.

gelguy commented 2 years ago

Thanks for the report! I can reproduce this.

notpeelz commented 2 years ago

Same problem happens when misspelling env vars, e.g :e $PWDD/

gelguy commented 2 years ago

I've pushed ec38c95331a3333f70924031f78c6302813baf1c which should fix this issue.

Could you help verify by pulling the latest master? Thanks!

notpeelz commented 2 years ago

I've pushed ec38c95 which should fix this issue.

Could you help verify by pulling the latest master? Thanks!

Yup! That fixes the slow env var expansion issue.