liuchengxu / vim-clap

:clap: Modern performant fuzzy picker, tree-sitter highlighting, and more, for both Vim and NeoVim
https://liuchengxu.github.io/vim-clap/
MIT License
2.11k stars 86 forks source link

The +name-only options for Clap-files does not operate with fzf search syntax #958

Closed ktjjang closed 1 year ago

ktjjang commented 1 year ago

Instructions: Replace the template text and remove irrelevant text (including this line) Warning: if you don't fill this issue template and provide the reproducible steps the issue could be closed directly.

Environment (please complete the following information): OS: NAME="Ubuntu" VERSION="20.04.6 LTS (Focal Fossa)" (Neo)Vim version: vim version 8.2.5172 vim-clap version: latest commit https://github.com/liuchengxu/vim-clap/commit/4aea08196fb9d3dcf365192f4bf7da7d3813a23d (HEAD -> master, origin/master, origin/HEAD) Upgrade clap to 4.2) Have you reproduced with a minimal vimrc: yes, it's still reproduced Have you updated to the latest plugin version: yes, it's still reproduced Have you upgraded to/compiled the latest Rust binary: yes, it's still reproduced

Describe the bug There are directories and files that contain the word "devfreq" as shown below. 0421_2_files

When I open the Clap-files with +name-only option and type word devfreq. Clap-files show me the correct results like below. It show only files containing the word devfreq. 0421_2_nameonly

If I type word 'devfreq to get exact-match results. accroding to following fzf search syntax I expected only files that has the exact name of devfreq to be shown.

Token Match type Description
sbtrkt fuzzy-match Items that match sbtrkt
'wild exact-match (quoted) Items that include wild
^music prefix-exact-match Items that start with music
.mp3$ suffix-exact-match Items that end with .mp3
!fire inverse-exact-match Items that do not include fire
!^music inverse-prefix-exact-match Items that do not start with music
!.mp3$ inverse-suffix-exact-match Items that do not end with .mp3

But, when I type 'devfreq, the directories are also shown. That is, both file and directories are shown like below 0421_3_alsodirectory

Clap debug

            has ctags: Universal Ctags 0.0.0 (+json)
            has cargo: 1
            has maple: /home/kitak/my-settings/bundle/vim-clap/bin/maple
           maple info: version 0.1.43 (git v0.43-1-g31b0b3b), compiled at: 2023-04-20 07:15:05.544219667 -07:00, built for x86_64-unknown-linux-gnu by rustc 1.68.2 (9eb3afe9e 2023-03-27).
        rustc version: rustc 1.68.2 (9eb3afe9e 2023-03-27)
     Current FileType: 
Third Party Providers: []
       Global Options:
    let g:clap#autoload_dir = '/home/kitak/my-settings/bundle/vim-clap/autoload'
    let g:clap#popup#display = {'shrink': function('46'), 'open': function('<SNR>32_create_display'), 'shrink_if_undersize': function('45')}
    let g:clap#popup#preview = {'line_count': function('<SNR>31__line_count'), 'show': function('47'), 'hide': function('48'), 'clear': function('49'), 'add_highlight': function('51'), 'get_lines': function('<SNR>31__get_lines'),
 'getbufvar': function('<SNR>31__getbufvar'), 'setbufvar_batch': function('<SNR>31__setbufvar_batch'), 'setbufvar': function('<SNR>31__setbufvar'), 'win_is_valid': function('<SNR>31__win_is_valid'), 'goto_win': function('<SNR>31_
_goto_win'), 'set_syntax': function('50')}
    let g:clap#provider_alias = {'gfiles': 'git_files', 'hist:': 'command_history', 'hist/': 'search_history'}
    let g:clap_background_shadow_blend = 50
    let g:clap_disable_bottom_top = 0
    let g:clap_disable_matches_indicator = v:false
    let g:clap_disable_run_rooter = v:false
    let g:clap_enable_background_shadow = v:false
    let g:clap_enable_debug = v:false
    let g:clap_enable_icon = 0
    let g:clap_forerunner_status_sign = {'done': '•', 'running': '!', 'using_cache': '*'}
    let g:clap_insert_mode_only = v:false
    let g:clap_multi_selection_warning_silent = 0
    let g:clap_no_matches_msg = 'NO MATCHES FOUND'
    let g:clap_open_action = {'ctrl-v': 'vsplit', 'ctrl-x': 'split', 'ctrl-t': 'tab split'}
    let g:clap_open_preview = 'always'
    let g:clap_popup_border = 'rounded'
    let g:clap_preview_direction = 'AUTO'
    let g:clap_preview_size = 5
    let g:clap_providers_relaunch_code = '@@'
    let g:clap_search_box_border_style = 'nil'
    let g:clap_search_box_border_symbols = {'nil': ['', ''], 'curve': ['', ''], 'arrow': ['', '']}
  Provider Variables:
                     []
liuchengxu commented 1 year ago

That's expected as +name-only is only intended to work with fuzzy matching which is the default searching behavior, the exact and inverse matching still operates against the full line content.

To include the files whose name match devfreq but not include the directory devfreq, you can use devfreq !devfreq/.