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:
parent
ab0e7cbc13
commit
d844d4f82e
@ -2,3 +2,11 @@ vim.opt_local.shiftwidth = 2
|
|||||||
vim.opt_local.modeline = true
|
vim.opt_local.modeline = true
|
||||||
vim.opt_local.wrap = false
|
vim.opt_local.wrap = false
|
||||||
vim.opt_local.conceallevel = 1
|
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
|
||||||
|
@ -66,9 +66,6 @@ return {
|
|||||||
vim.api.nvim_set_hl(0, "org_bold_delimiter", { link = "@punctuation.delimiter" })
|
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_underline_delimiter", { link = "@punctuation.delimiter" })
|
||||||
vim.api.nvim_set_hl(0, "org_strikethrough_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,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user