Skip to content

Commit bf65774

Browse files
fix(mininit): Ensure minimal init works on 0.11
Also preinstall grammar on 0.11 correctly if missing
1 parent 44adb0f commit bf65774

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lua/orgmode/config/init.lua

+3-4
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ function Config:__index(key)
3030
end
3131

3232
function Config:install_grammar()
33-
local ok = pcall(vim.treesitter.language.add, 'org')
34-
if ok then
35-
return
33+
local ok, result, err = pcall(vim.treesitter.language.add, 'org')
34+
if not ok or (not result and err ~= nil) then
35+
require('orgmode.utils.treesitter.install').run()
3636
end
37-
require('orgmode.utils.treesitter.install').run()
3837
end
3938

4039
---@param url? string

scripts/minimal_init.lua

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ local nvim_root = tmp_dir .. '/nvim_orgmode'
33
local lazy_root = nvim_root .. '/lazy'
44
local lazypath = lazy_root .. '/lazy.nvim'
55

6+
for _, name in ipairs({ "config", "data", "state", "cache" }) do
7+
vim.env[("XDG_%s_HOME"):format(name:upper())] = nvim_root .. "/" .. name
8+
end
9+
610
-- Install lazy.nvim if not already installed
711
if not vim.loop.fs_stat(lazypath) then
812
vim.fn.system({

0 commit comments

Comments
 (0)