Skip to content

Commit

Permalink
fix(mininit): Ensure minimal init works on 0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
kristijanhusak committed Dec 21, 2024
1 parent db7f044 commit 12d2324
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lua/orgmode/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ function Config:__index(key)
end

function Config:install_grammar()
local ok = pcall(vim.treesitter.language.add, 'org')
if ok then
return
local ok, _, err = pcall(vim.treesitter.language.add, 'org')
if not ok or err ~= nil then
require('orgmode.utils.treesitter.install').run()
end
require('orgmode.utils.treesitter.install').run()
end

---@param url? string
Expand Down
4 changes: 4 additions & 0 deletions scripts/minimal_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ local nvim_root = tmp_dir .. '/nvim_orgmode'
local lazy_root = nvim_root .. '/lazy'
local lazypath = lazy_root .. '/lazy.nvim'

for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = nvim_root .. "/" .. name
end

-- Install lazy.nvim if not already installed
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
Expand Down

0 comments on commit 12d2324

Please sign in to comment.