Coder Social home page Coder Social logo

wrongly parsed equation about nabla.nvim HOT 11 CLOSED

jbyuki avatar jbyuki commented on May 18, 2024
wrongly parsed equation

from nabla.nvim.

Comments (11)

max397574 avatar max397574 commented on May 18, 2024

just had the same with a fraction

from nabla.nvim.

jbyuki avatar jbyuki commented on May 18, 2024

Could you try to pull the latest and see if the issue still persists? The equation looks fine for me.
Otherwise what delimiters do you use?

from nabla.nvim.

max397574 avatar max397574 commented on May 18, 2024

it still doesn't work
it happens with $xxx$, $$xxx$$ and \[xxx\]

from nabla.nvim.

jbyuki avatar jbyuki commented on May 18, 2024

Could be another plugin interferring, I just ran it the test case on the Github CI and the equation is displayed correctly.

The following code should give the formula in an array:

local parser = require("nabla.latex")
local exp = parser.parse_all([[y_{unten}=-\sqrt{r^2-x^2}]])
local ascii = require("nabla.ascii")
local g = ascii.to_ascii({exp}, 1)
local drawing = vim.split(tostring(g), "\n") -- table of lines with the formula in ASCII form

If the array of lines is correct, the issue is when displaying into a popup.

from nabla.nvim.

jbyuki avatar jbyuki commented on May 18, 2024

Have you got a clue on what was wrong? I cannot reproduce this so it's difficult for me to do anything.

from nabla.nvim.

max397574 avatar max397574 commented on May 18, 2024

the output from the above code snippet is correct
but what's displayed in the window is wrong

from nabla.nvim.

jbyuki avatar jbyuki commented on May 18, 2024

Something must be happening to the buffer, like a auto-formatter kicking in. nabla.nvim only takes those lines and put them in a float buffer using vim.lsp.util.open_floating_preview. I'll close this for now because I don't think it's related to nabla.nvim directly.

from nabla.nvim.

max397574 avatar max397574 commented on May 18, 2024

it seems like noice.nvim causes issues
not sure if I should open an issue here or there

from nabla.nvim.

max397574 avatar max397574 commented on May 18, 2024

you have to pass stylize_markdown=false as an option to vim.lsp.util.open_floating_preview

from nabla.nvim.

max397574 avatar max397574 commented on May 18, 2024

that fixes this issue and also improves highlighting I just realized xD
@jbyuki

from nabla.nvim.

jbyuki avatar jbyuki commented on May 18, 2024

Thanks for the debug, I haven't installed noice so that's why I didn't see it but probably a lot have. I'll do that one change you mention.

from nabla.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.