vim-clap icon indicating copy to clipboard operation
vim-clap copied to clipboard

:Clap grep<cr>. Open fmultiple files with error filename with vim-devicons.

Open siuoly opened this issue 2 years ago • 9 comments

Environment :

  • OS: Arch Linux on Windows 10 x86_64, WSL2

  • (Neo)Vim version: VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Feb 16 2022 22:13:23) Included patches: 1-4345 Compiled by j.jith

  • vim-clap version: commit a5666c3b712018d6a5892624e7a63f8d0796531e (HEAD -> master, tag: v0.36, origin/master, origin/HEAD) Author: Liu-Cheng Xu [email protected] Date: Sat Aug 6 12:40:18 2022 +0800 v0.36

  • Have you reproduced with a minimal vimrc: Yes ( with additional vim-devicons plugin )

  • Have you updated to the latest plugin version: Yes

  • Have you upgraded to/compiled the latest Rust binary: yes

Describe the bug :Clap grep <tab> select multiple file, <c-t> open in a new tab The filename after first one be error. It start with the filetype icons like .

 1  a   "[No Name]"                    line 1
  7  a   "bash.txt"                     line 0
  8  a   " ./script_command"           line 0
  9 #    " ./ssh.txt"                  line 1
 11 %a   "min.vim"                      line 5

Clap debug

            has cargo: 1
            has maple: /home/siuoly/.vim/plugged/vim-clap/target/release/maple
           maple info: version 0.1.36 (git v0.36), built for x86_64-unknown-linux-gnu by rustc 1.63.0 (4b91a6ea7 2022-08-08).

         has +python3: 1
has py dynamic module: 1
            has ctags: ctags with JSON output support
        rustc version: rustc 1.63.0 (4b91a6ea7 2022-08-08)

    Current sync impl: Lua
     Current FileType: vim
Third Party Providers: []
       Global Options:
    let g:clap#autoload_dir = '/home/siuoly/.vim/plugged/vim-clap/autoload'
    let g:clap#popup#display = {'shrink': function('51'), 'open': function('<SNR>28_create_display'), 'width': 68, 'shrink_if_undersize': function('50')}
    let g:clap#popup#preview = {'line_count': function('<SNR>27__line_count'), 'show': function('52'), 'hide': function('53'), 'clear': function('54'), 'add_highlight': function('55'), 'get_lines': function('<SNR>27__get_lines'), 'getbufvar': function('<SNR>27__getbufvar'), 'setbufvar_batch': function('<SNR>27__setbufvar_batch'), 'setbufvar': function('<SNR>27__setbufvar'), 'winid': 1008, 'win_is_valid': function('<SNR>27__win_is_valid'), 'goto_win': function('<SNR>27__goto_win'), 'set_syntax': function('56'), 'bufnr': 6}
    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:false
    let g:clap_enable_debug = v:false
    let g:clap_enable_icon = 1
    let g:clap_forerunner_status_sign = {'done': '•', 'running': '!', 'using_cache': '*'}
    let g:clap_indicator_winid = 1009
    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': ['', '']}
    let g:clap_spinner_winid = 1011
  Provider Variables:
    let g:clap_provider_grep_enable_icon = 1

Expected behavior The filename should not be with prefix the filetype icon.

Screenshots

screenshot: xxx

Additional context

siuoly avatar Aug 15 '22 12:08 siuoly

Can you pull the latest commit and recompile the Rust binary locally? Should be fixed in the master. BTW, :Clap grep is deprecated due to the performance reason, :Clap grep2 is recommended.

liuchengxu avatar Aug 15 '22 13:08 liuchengxu

Yes , I use vim-plug , it is not update to latest. Using git pull it is fixed. Thank you for response!!

siuoly avatar Aug 15 '22 13:08 siuoly

the newer commit 8e47e5b8ab12327881f2010da2213563ddb64fd9, is still has this problem.

this change can fix this problem for me.

diff --git a/autoload/clap/state.vim b/autoload/clap/state.vim
index 0521693..d6890a9 100644
--- a/autoload/clap/state.vim
+++ b/autoload/clap/state.vim
@@ -179,7 +179,7 @@ function! clap#state#clear_pre() abort
         \ 'g:__clap_recent_files_dyn_tmp',
         \ ])
   let g:clap.display.initial_size = -1
-  let g:__clap_icon_added_by_maple = v:false
+  let g:__clap_icon_added_by_maple = v:true
   call clap#indicator#clear()
   call clap#preview#clear()
   if exists('g:__clap_forerunner_tempfile')

altair-albert avatar Aug 17 '22 01:08 altair-albert

That doesn't make sense as the default value shouldn't be true. Can you describe more what problem you are facing and provide a way to reproduce it so that it can be fixed properly? @altair-albert

liuchengxu avatar Aug 17 '22 02:08 liuchengxu

This my configure for vim-clap

" vim-clap
let g:clap_layout = { 'relative': 'editor' }
let g:clap_disable_run_rooter = v:true
let g:clap_enable_icon = v:true

When use :Clap grep<cr> for search file content with rg. I jump any seach result. vim will open file with '[icon]./file_path`.

i read some vim-clap source file. g:__clap_icon_added_by_maple will control add or remove icon, so i just set v:true for default.

altair-albert avatar Aug 17 '22 05:08 altair-albert

maple version

version 0.1.36 (git v0.36), built for x86_64-unknown-linux-musl by rustc 1.64.0-nightly (f6f9d5e73 2022-08-04).

altair-albert avatar Aug 17 '22 05:08 altair-albert

Can not reproduce based on your provided info. Please file a new issue with a minimal vimrc as you seem to have different reproduction steps. @altair-albert

liuchengxu avatar Aug 17 '22 08:08 liuchengxu

I tested again, it's works on tag v0.36. but failed on master (8e47e5b), i don't have special config.

altair-albert avatar Aug 18 '22 02:08 altair-albert

I tested again, it's works on tag v0.36. but failed on master (https://github.com/liuchengxu/vim-clap/commit/8e47e5b8ab12327881f2010da2213563ddb64fd9), i don't have special config.

Can't help more if you can't provide a minimal vimrc and the steps to reproduce as it works well on my side.

liuchengxu avatar Aug 18 '22 02:08 liuchengxu

Closing since the original issue is solved. If you still have some trouble with the latest master branch, please file a new issue with more info. @altair-albert

liuchengxu avatar Nov 13 '22 10:11 liuchengxu