Commits

ZyX_I  committed 0e1e8ca

@frawor: Improved s:F.normpath code

  • Participants
  • Parent commits 3163ec6

Comments (0)

Files changed (1)

File plugin/frawor.vim

 endfunction
 "▶1 normpath        :: path + FS → path
 let s:sep=fnamemodify(expand('<sfile>:h'), ':p')[-1:]
+let s:sesep=escape(s:sep, '\&~')
+let s:resep='\V'.escape(s:sep, '\').'\+'
 function s:F.normpath(path)
-    return expand(fnameescape(substitute(resolve(a:path),
-                \                        '\V'.escape(s:sep, '\').'\+',
-                \                        escape(s:sep, '\&~'), 'g')), 1)
+    return substitute(expand(fnameescape(resolve(a:path)), 1),
+                \     s:resep, s:sesep, 'g')
 endfunction
 "▶1 parseplugpath   :: filename + FS → (plugtype, plid, runtimepath)
 let s:rtpcache={}