Closed hahuang65 closed 7 months ago
Molten doesn't have anything to do with diagnostics, that option shouldn't (doesn't) affect diagnostics at all.
That's what I thought should be the case, but it doesn't seem to be.
The only change is vim.g.molten_virt_lines_off_by_1 = true
this could possibly be the weirdest bug I've ever encountered. Which plugin are you using for the pretty diagnostics? I can look into it.
assuming that it's lsp-lines
assuming that it's lsp-lines
yup
I'm not able to replicate this :/
If you could provide a minimal configuration that can still replicate it that'd be great.
There's a minimal config in the docs folder, you can start with that, add otter and lsp lines, and the provide a simple example and what you do to get the bug to occur. If it still reproduces then I can debug. If it doesn't, then we know it's somewhere else in your config and we can look into that.
@benlubas thanks for looking into it. I'll try to get a minimal reproducible config tomorrow and let you know :)
Okay, very curious. I was trying to make a minimal reproduction config, but got stuck at getting Quarto to run. It just wouldn't run, neither would otter.
So I tried a wholesale copy of my existing config, and was going to remove config bit by bit until the issue resolved... which is when I noticed something.
If I open the file directly with nvim notebooks/notebook.ipynb
, Quarto does NOT activate automatically. I have to run :QuartoActivate
... at which point, the diagnostics are on the correct line.
However, if I open nvim .
and use netrw to navigate to notebooks/notebook.ipynb
, Quarto will automatically run... and the diagnostics will be off by 1.
Right, so if I just remove
local ok, quarto = pcall(require, "quarto")
if ok then
quarto.activate()
end
which is the contents of after/ftplugin/markdown.lua
then I have to manually activate... which "fixes" the issue.
I've also tried moving it to ftplugin/markdown.lua
instead, thinking it might be an order of operations issue, but that results in teh same off-by-1 behavior.
Does it still happen without molten installed?
Aha! Yes, it DOES still happen with molten removed from the equation. I'm guessing this is an otter issue then.
makes it such taht the output is outside the code fence markers...
But I also use virtual text for my diagnostics. This makes all the LSP diagnostics appear 1 line lower than where they actually should be.
Is there any way to have the offset ONLY apply to the output text?