-
Notifications
You must be signed in to change notification settings - Fork 10
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
Compatibility with norg? #16
Comments
Thanks for reporting! I'm not able to reproduce this, are you on latest If so could you send me what the output of:
and
are. Assuming that this is the first injection in your file. If not change the |
Will get those values, but for clarity, what is the intended way to accept what's in the float and send it back to the main file? I was using |
Yes, all of |
Tried running that command, but got an error. I run this after editing the first code block in a norg document with FeMaco?
|
Thanks for trying, I suspect the index is not correct. Would you mind running the following instead to print all the injections: local bufnr = 1
for _, match in ipairs(require('nvim-treesitter.query').get_matches(bufnr, 'injections')) do
for capture_name, capture in pairs(match) do
local node = capture.node
print(capture_name)
print(' text: ', vim.treesitter.get_node_text(node, bufnr))
print(' range: ', vim.treesitter.get_node_range(node))
end
print()
end adjusting the |
Set the bufnr to 0 for current buffer
|
Oh hold, I see now, the You can try again but just end with a newline. |
I've tested with a few other languages and it does seem to work a bit better. For some reason not working with fennel. Does the same happen to you with fennel or is it unique to my config? |
Could it be that you have some formatter which removes newlines at the end of a file upon save for fennel? It does not happen for me but I have no setup for fennel. |
That's what I was thinking too. Will try disabling it in those buffers. |
If it is useful for you, maybe we can add an optional setting to always include the newline when updating the buffer. Then you perhaps wouldn't have to disable formatting (which is a pity). What's the new issue actually? |
@eccentric-j I opened #17 to optionally be able to ensure newlines. So for example you can configure this as: require('femaco').setup({
ensure_newline = function(base_filetype)
return base_filetype == 'norg'
end,
}) and then you don't have to disable the formatting. Let me know if that works for you. |
Trying to use this with https://github.com/nvim-neorg/neorg
The good news is using
:FeMaco
does work and displays the float with the code, and I think it's highlighted correctly.The bad news if I invoke some form of
:wq
after adding some lines, it replaces the@end
tag with the new line.The text was updated successfully, but these errors were encountered: