surmon-china / vue-codemirror

@codemirror code editor component for @vuejs
https://github.surmon.me/vue-codemirror
MIT License
3.25k stars 379 forks source link

Rendering issue #112

Open rogeralsing opened 4 years ago

rogeralsing commented 4 years ago

I'm having some bad rendering going on in my app.

Opening the editor shows code like so. Here all text is selected, and the selection is completely off, it is not aligned to the actual text.

Skärmavbild 2020-01-05 kl  12 37 49

In this next image, the browser window is resized and the selection size is now correct. But, there are still some form of error with the gutter/linenumbers compared to the content, see how the first column of text is hidden behind the gutter.

Skärmavbild 2020-01-05 kl  12 38 28

Is there some known issues and fixes for this? If it matters, the editor is hosted inside a Vuetify based app.

if not, I will try to recreate a reproduction for this.

uchm4n commented 4 years ago

I had same issue in Vuetify based app. I fixed it rearranging css files. Reason is that when you import themes and addons it adds css files after your main css file. I move main css file in a body tag and now it works. don't know why is this happening but clearly it's a css bug

esa89 commented 4 years ago

I had same issue in Vuetify based app. I fixed it rearranging css files. Reason is that when you import themes and addons it adds css files after your main css file. I move main css file in a body tag and now it works. don't know why is this happening but clearly it's a css bug

Hello @uC137 i am using vuetify too, i had an issue, in my web i must click the editor to show the code. Did you have same problem? if not, can you help me? before click image

after click image

uchm4n commented 4 years ago

you could use css preload <link rel="preload">
https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content

skyzhao1223 commented 4 years ago

I'm working on a Vuetify based Electron app, and facing the same problem. image

floydqwz commented 3 years ago

I have the same problems as described above. Using CodeMirror + Vuetify. Any workarounds would be helpful.

topeysoft commented 3 years ago

Anyone still having this issue might be able to fix it by setting the fixedGutter property to false (it true by default)

bitbw commented 2 years ago

仍然有此问题的任何人都可以通过将fixedGutter属性设置为false(默认情况下为 true)来修复它

Yes, but why