From 6bad0ab8d90ee9a9f440489f0003cfcc1440c759 Mon Sep 17 00:00:00 2001 From: sdeg Date: Wed, 5 Aug 2020 12:39:24 +0200 Subject: [PATCH 1/2] FIXED: filereadable('//.editorconfig') took too long under mingw64. GetFilenames is changed to manage paths with a trailing semantically-neutral '/.', thus avoiding to check l:path=='/' at each iteration. --- plugin/editorconfig.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/editorconfig.vim b/plugin/editorconfig.vim index de218de83..d5a0178c1 100644 --- a/plugin/editorconfig.vim +++ b/plugin/editorconfig.vim @@ -186,7 +186,8 @@ function! s:GetFilenames(path, filename) " {{{1 let l:path_list = [] let l:path = a:path while 1 - let l:path_list += [l:path . '/' . a:filename] + " the trailing /. avoids waste of time under mingw64 when l:path='/' + let l:path_list += [ '/.' . l:path . '/' . a:filename] let l:newpath = fnamemodify(l:path, ':h') if l:path == l:newpath break From b876e6bdb50ac0f02485a67dba3398d7717d62bb Mon Sep 17 00:00:00 2001 From: sdeg Date: Thu, 13 Aug 2020 12:09:53 +0200 Subject: [PATCH 2/2] FIXED: Windows support added. --- plugin/editorconfig.vim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugin/editorconfig.vim b/plugin/editorconfig.vim index d5a0178c1..72fabc00e 100644 --- a/plugin/editorconfig.vim +++ b/plugin/editorconfig.vim @@ -186,8 +186,11 @@ function! s:GetFilenames(path, filename) " {{{1 let l:path_list = [] let l:path = a:path while 1 - " the trailing /. avoids waste of time under mingw64 when l:path='/' - let l:path_list += [ '/.' . l:path . '/' . a:filename] + if l:path == '/' + let l:path_list += [ '/' . a:filename] + else + let l:path_list += [ l:path . '/' . a:filename] + endif let l:newpath = fnamemodify(l:path, ':h') if l:path == l:newpath break