-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incompatibility with md-headers, a plugin to navigate through the headings of .md .rmd. #353
Comments
This is there already <LocalLeader>gn
<LocalLeader>gN Does calling |
I installed "md-headers.nvim" and can replicate the bug. Running local parser = vim.treesitter.get_parser(bufnr, "markdown", {}) which is the same command called by our local md_query = vim.treesitter.query.parse(
"markdown",
[[
(atx_heading) @md_heading
]]
) |
Interesting. Not sure how this could potentially affect |
@SoaresAlisson, could try the "new_get_lang" brach, please? |
Wow! |
Unfortunately, I realized that the bug was not fixed... |
I will do my best to explore this tomorrow. |
After calling |
I think I have fixed the issue. @SoaresAlisson, @jalvesaq mind testing this branch? https://github.com/R-nvim/R.nvim/tree/fix-wrong-filetype-md-header |
…le for code chunk parsing closes #353
…le for code chunk parsing closes #353
It didn't work with this Quarto document:
After running |
I found the issue. It seems that the buffer becomes 1 based after calling Try with this document:
With this branch, call sendline on |
I think this comes to this Lines 121 to 132 in 493de62
With the node |
if node and node:type() == "program" then node = node:child(0) end
vim.print("node: ", node:range()) Node range change after calling |
if node then vim.schedule(function() end) end
vim.print("node: ", node:type()) Before, the type is |
Is it a bug in md-headers? Or in Neovim? |
Not sure, still scratching my head to understand what is going on. |
This comment has been minimized.
This comment has been minimized.
If we comment out the html parsing it works M.get_headings = function(bufnr)
local md_headings = _query_md(bufnr) or {}
-- local html_headings = _query_html(bufnr) or {}
local headings = {}
for _, h in ipairs(md_headings) do
table.insert(headings, h)
end
-- for _, h in ipairs(html_headings) do
-- table.insert(headings, h)
-- end
headings = _sort_headings(headings)
return headings
end |
So, at least for some tree-sitter operations, |
yes, because doing |
Not an issue, but an incompatibility between packages. Must I maybe put it on "Discussions"?
I installed the https://github.com/AntonVanAssche/md-headers.nvim/wiki/Installation and loved the idea to easily navigate through the headers. Maybe in the future can I fork it and try to implement a chunk navigation, like in RStudio. But for now, my knowledges in Lua is very limited.
Well, after installing the plugin (I'm using Lazyvim) and enabling more formats
ft = { "markdown", "rmd", "Rmd", "qmd" }
, everything works fine until I call any function of the package, likeMDHeaders
orMDHeadersTelescope
. After that, I cannot send code to terminal "not inside R or Python Chunk" and when I try to comment, it uses HTML comment<!--
everywhere, instead of#
. Has anyone any clue on how to solve this problem? Or knows anybody an alternative, similar plugin? For me, the best solution would be to easily navigate through the names of the chunks.Thanks!
The text was updated successfully, but these errors were encountered: