Skip to content

Setting ignore_files results in errors when searching #102

@oxysoft

Description

@oxysoft

If I add simply this to my config:

let g:far#ignore_files = [ '.meta' ]

It results in the following when I try searching

Error detected while processing function Find[22]..far#find[43]..<SNR>197_assemble_context[55]..far#executors#py3#execute[8]..far#rpc#invoke[9]..provider#python3#Call:                                                                       
line   18:                                                                                                                                                                                                                                    
Error invoking 'python_eval' on channel 8 (python3-script-host):                                                                                                                                                                              
error caught in request handler 'python_eval ['far_rpc_invoker()']':                                                                                                                                                                          
Traceback (most recent call last):                                                                                                                                                                                                            
  File "/usr/lib/python3/dist-packages/pynvim/plugin/script_host.py", line 169, in python_eval                                                                                                                                                
    return eval(expr, self.module.__dict__)                                                                                                                                                                                                   
  File "<string>", line 1, in <module>                                                                                                                                                                                                        
  File "<string>", line 3, in far_rpc_invoker                                                                                                                                                                                                 
  File "/home/nuck/vimfiles/plugged/far.vim/rplugin/python3/far/sources/shell.py", line 46, in search                                                                                                                                         
    logger.debug(f'Globbing with ripgrep: rg --files {rg_rules_glob(rules)} {rg_ignore_globs(ignore_files)}')                                                                                                                                 
  File "/home/nuck/vimfiles/plugged/far.vim/rplugin/python3/far/sources/far_glob.py", line 133, in rg_ignore_globs                                                                                                                            
    ignored = {val for sublist in [open(file, 'r').read().split('\n') for file in files] for val in sublist if len(val.strip()) > 0 and ("#" not in val)}                                                                                     
  File "/home/nuck/vimfiles/plugged/far.vim/rplugin/python3/far/sources/far_glob.py", line 133, in <listcomp>                                                                                                                                 
    ignored = {val for sublist in [open(file, 'r').read().split('\n') for file in files] for val in sublist if len(val.strip()) > 0 and ("#" not in val)}                                                                                     
FileNotFoundError: [Errno 2] No such file or directory: '.meta'   

Any ideas? I am up-to-date with master.

Perhaps this can help as well:

➜ rg --version
ripgrep 11.0.2
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions