Skip to content

Commit

Permalink
fix issue #149
Browse files Browse the repository at this point in the history
add g:Lf_MruWildIgnore
  • Loading branch information
Yggdroot committed May 11, 2018
1 parent 90185d5 commit faf20f5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions autoload/leaderf/python/leaderf/mruExpl.py
Expand Up @@ -4,6 +4,7 @@
import vim
import os
import os.path
from fnmatch import fnmatch
from .utils import *
from .explorer import *
from .manager import *
Expand All @@ -30,6 +31,9 @@ def getContent(self, *args, **kwargs):
lines = [name for name in lines if lfDecode(name).startswith(os.getcwd())]

lines = [line.rstrip() for line in lines] # remove the '\n'
wildignore = lfEval("g:Lf_MruWildIgnore")
lines = [name for name in lines if True not in (fnmatch(name, j) for j in wildignore['file'])
and True not in (fnmatch(name, "*/" + j + "/*") for j in wildignore['dir'])]

if len(lines) == 0:
return lines
Expand Down
11 changes: 11 additions & 0 deletions doc/leaderf.txt
Expand Up @@ -489,6 +489,17 @@ g:Lf_ShowHidden *g:Lf_ShowHidden*
To Specify whether to search hidden files and directories.
Default value is 0.(do not search hidden files and directories)

g:Lf_MruWildIgnore *g:Lf_MruWildIgnore*
This option indicates that do not display the MRU files whose file name
matches the patterns defined in it.
See |g:Lf_WildIgnore| for the usage of pattern.

Default value is: >
let g:Lf_MruWildIgnore = {
\ 'dir': [],
\ 'file': []
\}
<
==============================================================================
USAGE *leaderf-usage*

Expand Down
4 changes: 4 additions & 0 deletions plugin/leaderf.vim
Expand Up @@ -117,6 +117,10 @@ call s:InitVar('g:Lf_WildIgnore', {
\ 'dir': [],
\ 'file': []
\})
call s:InitVar('g:Lf_MruWildIgnore', {
\ 'dir': [],
\ 'file': []
\})
if &encoding ==? "utf-8"
call s:InitVar('g:Lf_StlSeparator', {
\ 'left': '',
Expand Down

0 comments on commit faf20f5

Please sign in to comment.