Skip to content

Commit

Permalink
Fixing #117 requires a change in Cmder.
Browse files Browse the repository at this point in the history
So, for best compatibility, clink-completions will have both .init.lua and
!init.lua files.
  • Loading branch information
chrisant996 committed Aug 15, 2022
1 parent fd89185 commit 93c1b8f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
12 changes: 9 additions & 3 deletions !init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-- The line below extends package.path with modules
-- directory to allow to require them
package.path = debug.getinfo(1, "S").source:match[[^@?(.*[\/])[^\/]-$]] .."modules/?.lua;".. package.path
-- Extend package.path with modules directory, if not already present, to allow
-- using require() with them.
--
-- Note: This happens in both .init.lua and !init.lua because older Cmder
-- versions don't know about !init.lua.
local modules_path = debug.getinfo(1, "S").source:match[[^@?(.*[\/])[^\/]-$]] .."modules/?.lua"
if not package.path:find(modules_path, 1, true--[[plain]]) then
package.path = modules_path..";"..package.path
end
9 changes: 9 additions & 0 deletions .init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- Extend package.path with modules directory, if not already present, to allow
-- using require() with them.
--
-- Note: This happens in both .init.lua and !init.lua because older Cmder
-- versions don't know about !init.lua.
local modules_path = debug.getinfo(1, "S").source:match[[^@?(.*[\/])[^\/]-$]] .."modules/?.lua"
if not package.path:find(modules_path, 1, true--[[plain]]) then
package.path = modules_path..";"..package.path
end

0 comments on commit 93c1b8f

Please # to comment.