From 3ea59b261f506d1237cf55dc8fc7869c5be6f06e Mon Sep 17 00:00:00 2001 From: Paul Kulchenko Date: Sat, 2 Jan 2016 17:08:06 -0800 Subject: [PATCH] Added processing of `package` command without extension in config (#555). --- src/main.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.lua b/src/main.lua index 1c3fceb20e..97fee72087 100644 --- a/src/main.lua +++ b/src/main.lua @@ -502,12 +502,15 @@ do -- package can be included as "package 'file.lua'" or "package 'folder/'" elseif type(p) == 'string' then local config = ide.configqueue[#ide.configqueue] + local pkg for _, packagepath in ipairs({'.', 'packages/', '../packages/'}) do local p = config and MergeFullPath(config.."/../"..packagepath, p) - if wx.wxDirExists(p) then - processPackages(loadToTab(nil, p, {}, false, ide.proto.Plugin)) - elseif wx.wxFileExists(p) then - processPackages(LoadLuaFileExt({}, p, ide.proto.Plugin)) + pkg = wx.wxDirExists(p) and loadToTab(nil, p, {}, false, ide.proto.Plugin) + or wx.wxFileExists(p) and LoadLuaFileExt({}, p, ide.proto.Plugin) + or wx.wxFileExists(p..".lua") and LoadLuaFileExt({}, p..".lua", ide.proto.Plugin) + if pkg then + processPackages(pkg) + break end end else