Shougo / ddu-filter-matcher_ignore_files

Ignore files matcher for ddu.vim
MIT License
0 stars 0 forks source link

Some items disappear on filtering #1

Closed kaosf closed 1 year ago

kaosf commented 1 year ago

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

Some items disappear on filtering. In my case, in file_rec sources.

Expected

All items that are not ignored should be shown.

Environment Information

NVIM v0.8.3
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Provide a minimal init.vim/vimrc without plugin managers (Required!)

let $CACHE = expand('~/.cache')
if !isdirectory($CACHE)
  call mkdir($CACHE, 'p')
endif
if &runtimepath !~# '/dein.vim'
  let s:dein_dir = fnamemodify('dein.vim', ':p')
  if !isdirectory(s:dein_dir)
    let s:dein_dir = $CACHE .. '/dein/repos/github.com/Shougo/dein.vim'
    if !isdirectory(s:dein_dir)
      execute '!git clone https://github.com/Shougo/dein.vim' s:dein_dir
    endif
  endif
  execute 'set runtimepath^=' .. substitute(
        \ fnamemodify(s:dein_dir, ':p') , '[/\\]$', '', '')
endif

"""" Config example

" Ward off unexpected things that your distro might have made, as
" well as sanely reset options when re-sourcing .vimrc
set nocompatible

" Set dein base path (required)
let s:dein_base = '~/.cache/dein/'

" Set dein source path (required)
let s:dein_src = '~/.cache/dein/repos/github.com/Shougo/dein.vim'

" Set dein runtime path (required)
execute 'set runtimepath+=' .. s:dein_src

" Call dein initialization (required)
call dein#begin(s:dein_base)

call dein#add(s:dein_src)

" Your plugins go here:
"call dein#add('Shougo/neosnippet.vim')
"call dein#add('Shougo/neosnippet-snippets')

"""" Added
call dein#add('vim-denops/denops.vim') " Need for ddu.vim
call dein#add('Shougo/ddu.vim')
call dein#add('Shougo/ddu-ui-ff')
call dein#add('Shougo/ddu-source-file_rec')
call dein#add('Shougo/ddu-filter-matcher_substring')
call dein#add('Shougo/ddu-filter-matcher_ignore_files')
"""" Added END

" Finish dein initialization (required)
call dein#end()

call ddu#custom#patch_global(#{
  \   ui: 'ff',
  \   sources: [
  \     #{name: 'file_rec'},
  \   ],
  \   sourceOptions: #{
  \     file_rec: #{
  \       matchers: ['matcher_substring', 'matcher_ignore_files'],
  \     },
  \   },
  \   filterParams: #{
  \     matcher_ignore_files: #{
  \       ignorePatterns: ['vendor/bundle'],
  \     },
  \   },
  \   uiParams: #{ ff: #{ startFilter: v:true } },
  \ })

How to reproduce the problem from neovim/Vim startup (Required!)

  1. Create experiment directory
  2. mkdir a; cd a
  3. Create items should be ignored.
  4. mkdir -p vendor/bundle/example
for i in `seq 1 1000`; do touch vendor/bundle/example/${i}.txt; done
  1. Create some items should be detected because their path don't contain vendor/bundle
  2. mkdir vendor/test
  3. touch vendor/test/a.txt
  4. touch a.txt

Launch Neovim and install plugins at first.

  1. nvim
  2. :call dein#install()

Execute ddu feature.

:call ddu#start(#{ sources: [#{ name: 'file_rec', params: #{ ignoredDirectories: ['.git', 'node_modules'] } }] })

At first, all items that I expect to be visible exist. There is no vendor/bundle/* item.

Like below:

vendor/test/a.txt
a.txt

Input ve in the filter window. All items will disappear.

Screenshot (if possible)

https://asciinema.org/a/LiPkbeAhHyVEZ6GuRJEz8ufgq

Upload the log messages by :redir and :message (if errored)

Nope

Other notes

Reference link

The issue template was copied from https://github.com/Shougo/ddu-ui-ff repository.

Shougo commented 1 year ago

It is the feature of matcher_substring.

Please see the documentation.

            *ddu-filter-matcher_substring-param-limit*
limit (number)
        The filter limit value.
        If filtered items length is bigger than it, the filter is
        ignored.

        Default: 1000

solution: You can change the order of filters.