fix(nvim): allow orgmode to properly parse treesitter for file

HACK: This is done by re-editing the buffer after a timeout. Shit way to
fix this, still need to do root-cause analysis.
This commit is contained in:
Price Hiller 2024-02-04 01:37:37 -06:00
parent ab0e7cbc13
commit d844d4f82e
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8
2 changed files with 8 additions and 3 deletions

View File

@ -2,3 +2,11 @@ vim.opt_local.shiftwidth = 2
vim.opt_local.modeline = true
vim.opt_local.wrap = false
vim.opt_local.conceallevel = 1
-- HACK: Correctly handle treesitter attachment. Without this folds and reformatting fall out of
-- sync and treesitter can fail to properly parse the buffer on content modifications.
if not vim.b.org_did_edit then
vim.b.org_did_edit = true
vim.defer_fn(vim.schedule_wrap(function()
vim.cmd.edit()
end), 10)
end

View File

@ -66,9 +66,6 @@ return {
vim.api.nvim_set_hl(0, "org_bold_delimiter", { link = "@punctuation.delimiter" })
vim.api.nvim_set_hl(0, "org_underline_delimiter", { link = "@punctuation.delimiter" })
vim.api.nvim_set_hl(0, "org_strikethrough_delimiter", { link = "@punctuation.delimiter" })
if vim.bo.filetype == "org" then
vim.cmd.doautocmd("FileType org")
end
end,
},
}