Comments (5)
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.
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.
This should be fixed. Feel free to reopen this if it still happens.
from compiler-explorer.nvim.
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.
Feel free to cherry-pick it
0787a64
from compiler-explorer.nvim.
Related Issues (9)
- Highlight selected line HOT 10
- [ Feature ] If first compilation is faild, the `CECompileLive` wont create autocmd `BufWritePost` HOT 2
- `:CEOpenWebsite` does not work for all languages
- Use builtin http provider once added in neovim
- Add the select language, compiler and flags from command HOT 3
- How to specify compiler for the languages "c++" HOT 2
- Do no cache vim.ui HOT 1
- CELoadExample command not working on release 0.8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compiler-explorer.nvim.