From 50ba776c738732b15fbc94a8e2142069571b3699 Mon Sep 17 00:00:00 2001 From: "Douglas M." Date: Fri, 8 Mar 2024 17:29:08 +0100 Subject: [PATCH] refactor(minimal_init): set rtp inside loadModule --- tests/minimal_init.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/minimal_init.ts b/tests/minimal_init.ts index 0d009a8..3316465 100644 --- a/tests/minimal_init.ts +++ b/tests/minimal_init.ts @@ -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); @@ -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; }; @@ -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");