Code Block Text Wrapping

The new code block is nice and I do like the syntax highlighting.
If you’re revamping the whole thing, I think it would be nice to have it be a bit more powerful.

Currently, the text inside a code block wraps. This is very frustrating to me as the code just doesn’t look right and may be hard to identify. There should be a sticky option where I can turn the wrapping off and the code block should just scroll horizontally.

It would be great to also pick a default language.

So far, Notion is the only company that I’ve seen get code blocks right so far (for the most part), except they don’t have basic syntax completion like adding the second bracket.

That’s it for now. Thanks for letting me try out your beta! It’s looking really nice so far!

18 Likes

I do agree on the line-wrapping. it would be great to have a toggle at the top right corner of the code block.

There should be a visual indicator at the front of the wrapped line, as well. Usually this is indicated by the missing line-number, but adding those would clutter code blocks.

In regards to bracket-closing and other features I made a suggestion here.

2 Likes

Scrolling code blocks get my vote, too. It’s a common approach on many web sites.

1 Like

+1 for scrolling code blocks. Code is difficult to read when the text wraps.

1 Like

Just want to add another +1 for scrolling code blocks. A lot of code samples are horribly unreadable without it, especially on smaller screens.

I think many devs won’t keep their snippets in bear solely because of this one issue.

1 Like

Hi there,

Regarding scrollable code blocks, this is something we have been experimenting with.

The wrapping of text option is not set in stone, but we’ve not found a satisfying solution in terms of the horizontal scrolling so far.

Don’t worry though, we’ll keep at it and see how we get on!

2 Likes

Any idea when you guys want Panda to join the production app? Normally I’d refrain from asking this, but I feel like it’s been in beta for years. Haha

Hi Marlon,

Thanks for taking the time to leave a comment.

We’re happy to see that you’re interested in this, but as widely known by our users - there’s no public deadline available.

Our aim is to release the product of our work when it reaches a quality benchmark, not an arbitrary deadline.

We understand that this can be frustrating for people, but we have our reasons for this.

Regarding our direction, we’re currently working on ironing out some bugs from the last test release of Panda.

There may be a small update or two to Panda after this, but then we’ll be getting ready to merge it with the current Bear app.

When we merge it with Bear it will update and replace your current Bear to the merger version, acting as a beta version for our users to test in app.

Once feedback is received from that and implemented, 2.0 will be pushed.

Our short, medium & long term plans can be seen here: https://www.reddit.com/r/bearapp/comments/pqkr1g/checking_in_with_bear_your_concerns_and_more/

Hoping this helps!

2 Likes

Is there any update on this? I’m hoping you guys were able to find a satisfying solution to horizontal scrolling code blocks.

1 Like

+1 for me.

If this is implemented, I can leave Obsidian.

2 Likes

I hope this proposal to be approved, but also be a toggle for tax wrapping. As I am not a coder but use the code blocks to distinguish between contents, I would still like to have the code wrapping option.

1 Like

There are horizontal scrolling code blocks in Obsidian?

Hi Marlon,

There’s no notable update at the moment as this feature request is not a priority one currently. Don’t worry though, any updates like this will always be announced on the forum here! :slight_smile:

1 Like

Quality benchmark along the philosophy of Bear, of course I appreciate that.
I think that scrolling code block is a MUST… but maybe Bear is not intented to use it as a learning programming notebook with LOT OF CODE in it. Is that a reason to not prioritize the scrolling code block? I have tried to avoid scrolling but is difficult to not need it, maybe is just me.
It is unfair to compare Notion and Bear code block… it must be difficult to receive lot of suggestions from people that appreciate Bear but need specifics features that may affect Bear consistent design. However, I need to understand why a feature like code block scrolling can be expendable

Talking of de facto standard code block representation, how about when the cursor is outside of the block to have the syntax shown in the top right? Also a copy button would be nice (that copies the block minus the backticks.)

1 Like

Definitely needs a copy button!

2 Likes

+1 for scrolling code blocks. Snippet are difficult to read… PLEASE !!!

2 Likes

Just check-in to see if this feature gaining any traction from Bear’s team?

1 Like

It is not among the things we are working on now, but it is something we would like to improve. Both scrolling and a copy button would require non-trivial changes to how code blocks are rendered.

1 Like

Looking forward to what this is implemented.