Skip to content

Commit 50ba776

Browse files
committed
refactor(minimal_init): set rtp inside loadModule
1 parent 0e27e60 commit 50ba776

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/minimal_init.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
const append = (option: any, value: any) => {
2+
option.append(option, value);
3+
};
4+
15
const loadModule = (module: string, source: string, directory?: string) => {
26
const moduleDir = directory || `/tmp/${module}`;
37
const directoryExists = vim.fn.isdirectory(moduleDir);
@@ -6,6 +10,8 @@ const loadModule = (module: string, source: string, directory?: string) => {
610
vim.fn.system(["git", "clone", source, moduleDir]);
711
}
812

13+
append(vim.opt.rtp, moduleDir);
14+
915
return moduleDir;
1016
};
1117

@@ -21,12 +27,7 @@ const telescopeDir = loadModule(
2127
"https://github.com/nvim-telescope/telescope.nvim",
2228
);
2329

24-
const append = (option: any, value: any) => {
25-
option.append(option, value);
26-
};
27-
2830
append(vim.opt.rtp, ".");
29-
append(vim.opt.rtp, plenaryDir);
30-
append(vim.opt.rtp, telescopeDir);
3131
vim.cmd("runtime plugin/plenary.vim");
32+
vim.cmd("runtime plugin/telescope.lua");
3233
require("plenary.busted");

0 commit comments

Comments
 (0)