ctrlpvim / ctrlp.vim

Active fork of kien/ctrlp.vim—Fuzzy file, buffer, mru, tag, etc finder.
ctrlpvim.github.com/ctrlp.vim
Other
5.57k stars 259 forks source link

Memory can be exceeded during certain regex search #530

Open n-hutton opened 4 years ago

n-hutton commented 4 years ago

I often find that I get the following error when typing:

Error detected while processing function <SNR>86_PrtFocusMap[1]..<SNR>86_PrtAdd[4]..<SNR>86_BuildPrompt:
line   15:
E363: pattern uses more memory than 'maxmempattern'

I can make it go away by allowing vim to use more memory for regexes: set maxmempattern=5000 - however this is clearly hiding an underlying problem, either in my filesystem or the plugin.

Vim:

VIM - Vi IMproved 8.1 (2018 May 18, compiled Oct 30 2019 23:05:43)
macOS version

relevant vimrc:

"""""""""""""""""""""""""""""""""""""""""
" CTRLP plugin

set maxmempattern=5000

"Let's use ctrl-f to find files - note it triggers from current working dir
let g:ctrlp_map = '<c-f>'

"Set the default opening command to use when pressing the above mapping: >
"let g:ctrlp_cmd = 'CtrlPMixed'

set runtimepath^=~/.vim/bundle/ctrlp.vim

" Set this to 0 to enable cross-session caching by not deleting the cache files upon exiting Vim:
let g:ctrlp_clear_cache_on_exit = 0
let g:ctrlp_cache_dir = $HOME . '/.cache/ctrlp'

"Set this to 1 to set searching by filename (as opposed to full path) as the default: >
let g:ctrlp_by_filename = 1

"When starting up, CtrlP sets its local working directory according to this variable: > 0 is pwd
let g:ctrlp_working_path_mode = '0'

" follow sym links
let g:ctrlp_follow_symlinks = 1

let g:ctrlp_max_files=0
let g:ctrlp_max_depth=40

" amount of most recently used files to keep track of (will prioritise when searching)
let g:ctrlp_mruf_max = 250

let g:ctrlp_prompt_mappings = {
    \ 'AcceptSelection("e")': ['<c-t>'],
    \ 'AcceptSelection("t")': ['<cr>', '<2-LeftMouse>'],
    \ }

Happy to help to resolve this.