Explorar o código

Verbatim matching of path prefix

Closes #146.
Marco Hinz %!s(int64=11) %!d(string=hai) anos
pai
achega
66083493ed
Modificáronse 1 ficheiros con 5 adicións e 4 borrados
  1. 5 4
      autoload/startify.vim

+ 5 - 4
autoload/startify.vim

@@ -401,9 +401,10 @@ endfunction
 
 " Function: s:filter_oldfiles {{{1
 function! s:filter_oldfiles(path_prefix, path_format) abort
-  let counter  = s:numfiles
-  let entries  = {}
-  let oldfiles = []
+  let path_prefix = '\V'. escape(a:path_prefix, '\')
+  let counter     = s:numfiles
+  let entries     = {}
+  let oldfiles    = []
 
   for fname in v:oldfiles
     if counter <= 0
@@ -420,7 +421,7 @@ function! s:filter_oldfiles(path_prefix, path_format) abort
       continue
     endif
 
-    if match(absolute_path, a:path_prefix)
+    if match(absolute_path, path_prefix)
       continue
     endif