Skip to content

Clap grep2 ++query=something doesn't work #711

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

Closed
fannheyward opened this issue Jun 22, 2021 · 10 comments · Fixed by #712
Closed

Clap grep2 ++query=something doesn't work #711

fannheyward opened this issue Jun 22, 2021 · 10 comments · Fixed by #712
Labels

Comments

@fannheyward
Copy link

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: macOS
  • (Neo)Vim version: nvim v0.5.0-dev+b585f723b
  • vim-clap version: v0.26
  • 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
:Clap grep2 ++query=something will show the window, but can't start to search with the input.

Clap debug


            has cargo: 1
            has maple: /Users/fannheyward/.config/nvim/plugged/vim-clap/target/release/maple
           maple info: version 0.1.26 (git v0.26), built for aarch64-apple-darwin by rustc 1.53.0 (53cb7b09b 2021-06-17).

         has +python3: 1
has py dynamic module: 1
            has ctags: ctags with JSON output support
    Current sync impl: Lua
     Current FileType: 
Third Party Providers: []
       Global Options:
    let g:clap#autoload_dir = '/Users/fannheyward/.config/nvim/plugged/vim-clap/autoload'
    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_optional_async = v:false
    let g:clap_disable_run_rooter = v:false
    let g:clap_enable_background_shadow = v:true
    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 = 'single'
    let g:clap_preview_direction = 'LR'
    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:
                     []

To Reproduce
Steps to reproduce the behavior:

  1. Create the minimal vimrc min.vim:
set nocompatible
set runtimepath^=/path/to/vim-clap
syntax on
filetype plugin indent on
  1. Start (neo)vim with command: vim -u min.vim

  2. Type :Clap grep2 ++query=something

  3. clap window shows, but didn't start to search

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@fannheyward fannheyward added the bug Something isn't working label Jun 22, 2021
@liuchengxu
Copy link
Owner

liuchengxu commented Jun 22, 2021

Works well for me. Can you provide a sample repo to reproduce? :Clap grep2 and input something to start the search, does this work?

@liuchengxu liuchengxu added unconfirmed and removed bug Something isn't working labels Jun 22, 2021
@fannheyward
Copy link
Author

It's very weird because Clap grep works as expected.

  1. cd .config/nvim/plugged/vim-clap/
  2. ./bin/maple version works
  3. nvim -u mini.vim
  4. :Clap grep2 will open the window
  5. input anything, loading but never filter the results.

Does there any special Python module related is needed? I didn't install the modules listed in pythonx/clap/Makefile.

set nocompatible
set runtimepath^=/Users/fannheyward/.config/nvim/plugged/vim-clap
syntax on
filetype plugin indent on

截屏2021-06-22 下午4 35 40

@liuchengxu
Copy link
Owner

liuchengxu commented Jun 22, 2021

Please try this patch and then recompile the binary locally via cargo build --release, BurntSushi/ripgrep#1892 is possibly related.

diff --git a/crates/maple_cli/src/commands/grep.rs b/crates/maple_cli/src/commands/grep.rs
index 69683c0..d0627a3 100644
--- a/crates/maple_cli/src/commands/grep.rs
+++ b/crates/maple_cli/src/commands/grep.rs
@@ -29,10 +29,10 @@ const RG_ARGS: [&str; 7] = [
 ];

 // Ref https://github.com/liuchengxu/vim-clap/issues/533
-#[cfg(windows)]
+// #[cfg(windows)]
 const RG_EXEC_CMD: &str = "rg --column --line-number --no-heading --color=never --smart-case '' .";
-#[cfg(not(windows))]
-const RG_EXEC_CMD: &str = "rg --column --line-number --no-heading --color=never --smart-case ''";
+// #[cfg(not(windows))]
+// const RG_EXEC_CMD: &str = "rg --column --line-number --no-heading --color=never --smart-case ''";

 #[derive(StructOpt, Debug, Clone)]
 pub struct Grep {

@liuchengxu liuchengxu added rg and removed unconfirmed labels Jun 22, 2021
@fannheyward

This comment has been minimized.

@liuchengxu
Copy link
Owner

Have you recompiled the Rust binary? Try running cargo build --release in the vim-clap directory.

I'm also using macOS with rg 13.0.0. The patch just fixes grep2 for me.

@fannheyward
Copy link
Author

fannheyward commented Jun 22, 2021

The patch works! I did cargo build --release with a global .cargo/config that changed target-dir. Thank you.

@fannheyward
Copy link
Author

@liuchengxu sorry to boring you, do you still work on this neoclide/coc.nvim#1732 (comment)?

@liuchengxu
Copy link
Owner

liuchengxu commented Jun 22, 2021

do you still work on this neoclide/coc.nvim#1732 (comment)?

Actually, I already have a basic working version but haven't found another time to polish and release it. Furthermore, since there are several LSP UI plugins already, plus I use it rarely in fact(I use dumb_jump a lot, which is good enough and more convenient for me), I don't know if this plugin will be published eventually :P.

@fannheyward
Copy link
Author

fannheyward commented Jun 22, 2021

Thank you for your reply. I did a test with dumb_jump, looks like it will list all refs, haven't find the good enough way, can you share something about it?

Update: found #659, will try it more

@liuchengxu
Copy link
Owner

@fannheyward dumb_jump probably won't bring more good for you if you find the language server you commonly work with already does a good job. It's more suitable for those who need to deal with some uncommon languages with immature LSP support, even though it does not know the semantics. Anyway, feel free to give any suggestions after your trial.

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

Successfully merging a pull request may close this issue.

2 participants