Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Scrollable CodeBloacks #5

Closed
xidsyed opened this issue Feb 15, 2022 · 3 comments
Closed

Feature Request: Scrollable CodeBloacks #5

xidsyed opened this issue Feb 15, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@xidsyed
Copy link

xidsyed commented Feb 15, 2022

Could you please add support for codeblocks to be scrollable. I am tired of the word wrap i have to deal with. been searching for a way to do it myself, no luck ☹. Everyonwe who codes can tell you that the default codeblock width isnt enough.. And wrapping code makes it look like a horrible mess :(
Great work on the theme btw. Super clean and aesthetic. Just needs a little polish.

@mbeckrich mbeckrich added bug Something isn't working enhancement New feature or request labels Feb 15, 2022
@mbeckrich
Copy link
Collaborator

Do you have line wrap enabled under options > editor? Disabling line wrapping from settings restored horizontal scrolling on my end. Let me look at using css to disable it only for codeblocks. Does this look like what you’re after? https://forum.obsidian.md/t/disable-word-wrap-for-code-blocks/13210/16

@mbeckrich
Copy link
Collaborator

@xidsyed I've spent some time playing around with this and can't seem to get it working. I've looked at some popular themes to get ideas and have not found a solution there either. I think part of the issue is in how codemirror renders codeblocks. I can get to where individual lines will scroll horizontally, but moving the entire block with them has been out of reach. (I think I found a way to get full horizontal scrolling of codeblocks in Obsidian's reading mode, but that's it.)

I will keep my eye out for ways around this and add a toggle for it in Style Settings if I come across anything that works. In the meantime, your best bet might be to disable linewrapping and/or readable line lengths in Obsidian's settings and then use a css snippet for a width you'd prefer. Sorry I don't have better news!

@mbeckrich mbeckrich removed the bug Something isn't working label Feb 23, 2022
@xidsyed
Copy link
Author

xidsyed commented Feb 28, 2022

Yeah. Super annoying to have code wrapped into a little block. Makes sense, I was able to do it without the livePreview. Let's Hope they come up with a fix for this soon.

@xidsyed xidsyed closed this as completed Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants