Skip to content

Commit

Permalink
refactor(minimal_init): set rtp inside loadModule
Browse files Browse the repository at this point in the history
  • Loading branch information
Massolari committed Mar 8, 2024
1 parent 0e27e60 commit 50ba776
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/minimal_init.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
const append = (option: any, value: any) => {
option.append(option, value);
};

const loadModule = (module: string, source: string, directory?: string) => {
const moduleDir = directory || `/tmp/${module}`;
const directoryExists = vim.fn.isdirectory(moduleDir);
Expand All @@ -6,6 +10,8 @@ const loadModule = (module: string, source: string, directory?: string) => {
vim.fn.system(["git", "clone", source, moduleDir]);
}

append(vim.opt.rtp, moduleDir);

return moduleDir;
};

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

const append = (option: any, value: any) => {
option.append(option, value);
};

append(vim.opt.rtp, ".");
append(vim.opt.rtp, plenaryDir);
append(vim.opt.rtp, telescopeDir);
vim.cmd("runtime plugin/plenary.vim");
vim.cmd("runtime plugin/telescope.lua");
require("plenary.busted");

0 comments on commit 50ba776

Please sign in to comment.