Skip to content

Commit

Permalink
Merge pull request #22 from QuantumVim/7-feat-runtime-path-modificati…
Browse files Browse the repository at this point in the history
…ons-and-user-config-after-directory

feat(#7): updatet test init
  • Loading branch information
quantumfate authored Aug 21, 2023
2 parents 0267ff3 + c776b6f commit a61f095
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
17 changes: 8 additions & 9 deletions lua/qvim/bootstrap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ function _G.get_qvim_cache_dir()
end

M.qvim_config_dir = get_qvim_config_dir()
M.qvim_state_dir = get_qvim_state_dir()
M.qvim_rtp_dir = get_qvim_rtp_dir()
M.qvim_cache_dir = get_qvim_cache_dir()
M.opt_dir = join_paths(get_qvim_data_dir(), "after", "pack", "lazy", "opt")
M.lazy_install_dir = join_paths(M.opt_dir, "lazy.nvim")
Expand Down Expand Up @@ -126,7 +128,7 @@ function M:init()
install_path = self.lazy_install_dir,
})

vim.opt.rtp = self:bootstrap()
vim.opt.rtp = self:bootstrap()

require("qvim.config"):init()

Expand Down Expand Up @@ -174,16 +176,12 @@ function M:bootstrap(stds, expands)
-- remove
vim.tbl_contains(
rtp_paths,
_G.join_paths(
vim.call("stdpath", what),
unpack(expand)
)
_G.join_paths(vim.call("stdpath", what), unpack(expand))
)
then
rtp:remove(_G.join_paths(
vim.call("stdpath", what),
unpack(expand)
))
rtp:remove(
_G.join_paths(vim.call("stdpath", what), unpack(expand))
)
end
if
not vim.tbl_contains(
Expand All @@ -201,6 +199,7 @@ function M:bootstrap(stds, expands)
end
return rtp
end

---Update qvimVim
---pulls the latest changes from github and, resets the startup cache
function M:update()
Expand Down
6 changes: 3 additions & 3 deletions tests/minimal_init.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
local path_sep = vim.loop.os_uname().version:match "Windows" and "\\" or "/"
local base_dir = os.getenv "QUANTUMVIM_CONFIG_DIR"
local path_sep = vim.loop.os_uname().version:match("Windows") and "\\" or "/"
local base_dir = os.getenv("QUANTUMVIM_RTP_DIR")
local tests_dir = base_dir .. path_sep .. "tests"

vim.opt.rtp:append(tests_dir)
require("qvim.bootstrap"):init()

-- NOTE: careful about name collisions
-- see https://github.com/nvim-lualine/lualine.nvim/pull/621
require "tests.qvim.helpers"
require("tests.qvim.helpers")

0 comments on commit a61f095

Please sign in to comment.