Git Product home page Git Product logo

Comments (5)

krady21 avatar krady21 commented on June 20, 2024

Hi. I've noticed this behavior before but I did not have the time to investigate. It seems that the problem comes from what the godbolt REST API sends back in the asm field when making an /api/compiler/g113/compile POST request. Some of the entries in the asm field that are used for line highlighting/jumping are lines that are outside the source buffer (eg: 616, 880). This means that we are either not setting a necessary config option in the compile body or there is a problem with the REST API itself. In the latter case, we should probably open an issue upstream. Either way, I think that wrapping the api.nvim_win_set_cursor() with a pcall might fix this temporarily until we find out what botches the REST API response.

from compiler-explorer.nvim.

krady21 avatar krady21 commented on June 20, 2024

The lines that are outside the buffer seem to be corresponding to library header files. Check lines 67 or 68 from the REST API response using dev tools here: https://godbolt.org/z/6nvch3aPh . I'll make sure to filter them before adding them to the highlights table.

from compiler-explorer.nvim.

krady21 avatar krady21 commented on June 20, 2024

This should be fixed. Feel free to reopen this if it still happens.

from compiler-explorer.nvim.

Fabian-programmer avatar Fabian-programmer commented on June 20, 2024

Thanks for the insights.

I don't think it fixed the bug, because the underlying problem is that the highlighter uses line number from other files than the buffer.
When the imported file has a line number which is smaller than the current buffers line number, it is going to highlight false lines.

from compiler-explorer.nvim.

Fabian-programmer avatar Fabian-programmer commented on June 20, 2024

Feel free to cherry-pick it
0787a64

from compiler-explorer.nvim.

Related Issues (9)

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.