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

Cannot filter hidden files with ++finder=fd -tf --hidden #980

Closed
phongnh opened this issue Jun 20, 2023 · 5 comments
Closed

Cannot filter hidden files with ++finder=fd -tf --hidden #980

phongnh opened this issue Jun 20, 2023 · 5 comments

Comments

@phongnh
Copy link
Contributor

phongnh commented Jun 20, 2023

Environment (please complete the following information):

  • OS: macOS
  • (Neo)Vim version: ???
  • vim-clap version:
  • Have you reproduced with a minimal vimrc: Yes
  • Have you updated to the latest plugin version: Yes
  • Have you upgraded to/compiled the latest Rust binary: Yes

Describe the bug

When I run Clap files! ++finder=fd --type f --hidden ., I cannot filter hidden files. However, I can filter hidden files with Clap files! ++finder=fd --type f . or Clap files! ++finder=fd --type f -H . (Please note that -H is same as --hidden)

Clap debug


            has ctags: Universal Ctags 6.0.0 (+json)
            has cargo: 1
            has maple: /Users/phong.nguyen/.vim/plugged/vim-clap/target/release/maple
           maple info: version 0.1.44, compiled at: 2023-06-19 23:37:11.084961 +07:00, built for aarch64-apple-darwin by rustc 1.70.0 (90c541806 2023-05-31).

        rustc version: rustc 1.70.0 (90c541806 2023-05-31)

     Current FileType: 
Third Party Providers: []
       Global Options:
    let g:clap#autoload_dir = '/Users/phong.nguyen/.vim/plugged/vim-clap/autoload'
    let g:clap#popup#display = {'shrink': function('61'), 'open': function('<SNR>36_create_display'), 'shrink_if_undersize': function('60')}
    let g:clap#popup#preview = {'line_count': function('<SNR>35__line_count'), 'show': function('62'), 'hide': function('63'), 'clear': function('64'), 'add_highlight': function('66'), 'get_lines': function('<SNR>35__get_lines'), 'getbufvar': function('<SNR>35__getbufvar'), 'setbufvar_batch': function('<SNR>35__setbufvar_batch'), 'setbufvar': function('<SNR>35__setbufvar'), 'win_is_valid': function('<SNR>35__win_is_valid'), 'goto_win': function('<SNR>35__goto_win'), 'set_syntax': function('65')}
    let g:clap#provider_alias = {'gfiles': 'git_files', 'hist:': 'command_history', 'hist/': 'search_history'}
    let g:clap_actions = ['open-config', 'generate-toc', 'update-toc', 'delete-toc']
    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_layout = {'relative': 'editor'}
    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 = 'UD'
    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': ['', '']}
    let g:clap_theme = 'atom_dark'
  Provider Variables:
                     []

To Reproduce
Steps to reproduce the behavior:

asciicast

  1. Create the minimal vimrc min.vim:
set encoding=utf-8
scriptencoding utf-8

set nocompatible
set cmdheight=2
set termguicolors
set runtimepath^=~/.vim/plugged/vim-clap

syntax on
filetype plugin indent on

let g:clap_theme = 'atom_dark'
let g:clap_layout = { 'relative': 'editor' }
let g:clap_preview_direction = 'UD'
  1. Start (neo)vim with command: vim -u min.vim

  2. Please view screencast

  3. See error

@phongnh phongnh added the bug Something isn't working label Jun 20, 2023
@liuchengxu
Copy link
Owner

liuchengxu commented Jun 21, 2023

The performance of Rust backend has been significantly improved by using an interprocess instead of collecting the output from an external process (see #875), so there are some changes on the user end, but it generally simplifies the flow:

  • ! in :Clap files! is no longer necessary, the cache thing has been deprecated, now the results are always the latest and it's even faster.
  • The files provider has been re-implemented on the Rust side, ++finder has been retired, now you only need to specify --hidden to search the hiddle files.

let hidden = provider_args.iter().any(|s| s == "--hidden");

Therefore, :Clap files --hidden is enough, we can also add this flag in the config.toml so that you don't have to specify it every time.

@liuchengxu liuchengxu added need-update-docs and removed bug Something isn't working labels Jun 21, 2023
@phongnh
Copy link
Contributor Author

phongnh commented Jun 21, 2023

Thanks for your updates.

Therefore, :Clap files --hidden is enough, we can also add this flag in the config.toml so that you don't have to specify it every time.

What I need to update? As followings?

[files]
hidden = true

Also, If files provider was implemented on server side, fd or rg is not used on server as well?

@liuchengxu
Copy link
Owner

liuchengxu commented Jun 21, 2023

we can also add this flag in the config.toml so that you don't have to specify it every time.

Not yet implemented, but trivial to support it.

fd or rg is not used on server as well?

True, these binaries are needless and unused for files provider, all you need is the Rust binary maple.

@phongnh
Copy link
Contributor Author

phongnh commented Jun 21, 2023

Thanks. Closing the issue now.

@phongnh phongnh closed this as completed Jun 21, 2023
@liuchengxu
Copy link
Owner

The argument parsing will be completely rewritten, feel free to subscribe #981 and leave your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants