From 525b01f2d3e9d7b7d0c2d689c7752e65f5831819 Mon Sep 17 00:00:00 2001 From: Boris Zhidkov Date: Fri, 20 Sep 2019 16:57:58 +0300 Subject: [PATCH] resolve ./Component as Component/Component.js --- autoload/node/lib.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/autoload/node/lib.vim b/autoload/node/lib.vim index 1c7a8c1..40124f8 100644 --- a/autoload/node/lib.vim +++ b/autoload/node/lib.vim @@ -78,7 +78,14 @@ function! s:resolveFromDirectory(path) " from the directory defaulting to ./index.js or it was the package.json " which referred to ./index, which in itself could mean both ./index.js and " ./index/index.js. - return s:resolveSuffix(a:path . "/index") + let l:res = s:resolveSuffix(a:path . "/index") + if !l:res + let l:list = split(a:path, "/") + let l:dirname = l:list[-1] + " tring to resolve Component/Component.js + let l:res = s:resolveSuffix(a:path . "/" . l:dirname) + endif + return l:res endfunction function! s:mainFromPackage(path)