Text wrapping in code blocks

Finally decided to organize the notes I have all over different apps, and Bear was the chosen one (fantastic app guys!). One thing that I noticed though, is the use of line-wrapping inside code-blocks, which goes against the standard presentation (i.e. horizontally scrollable once past the available width). It would be great to have a toggle in settings to enable/disable the wrapping (in case anyone actually wants the wrapping). Disabling the wrapping not only would comply with code-blocks’ expected standard behaviour, but would also fix them for Bear on iPhone, which currently “breaks” any code more than a few columns wide.

Thanks for such an awesome app!

PS: Is this the best place for feedback/feature requests?


Just noticed another good example on Bear’s official twitter feed :sweat_smile:

Yep, wrapping is not very nice for code. We are considering adding side-scrolling on the code block if the code doesn’t fit, but that is a bit further down the line as it requires an overhaul on how code is rendered.


Gotcha, sad to hear it’s not "a quick fix" :smiling_face_with_tear:

Thanks for the reply! And all the best, really enjoying the app :heart_hands:

Excited to hear that the folks on the inside want this as well. Been asking for this for a long time. Scrolling code blocks and a copy button. Maybe a little extra padding around the edges would be nice as well :stuck_out_tongue_closed_eyes:

Glad to see this thread! Better handling of word-wrapping for code is critical for me - who uses Bear extensively for code-blocks.

I would love the horizontal scrolling for code blocks. I understand that isn’t easy. A few interim steps might be easier and still help a lot:

  1. no max width for code-blocks. On MacOS - if the code blocks were always full-width, enlarging the window would solve this pretty well.
  2. syntax or at least indent-aware wrapping - ideally, syntax-aware wrapping would be great, but just indenting the wrapped line to the same indent it started at would help A LOT. If the indent is, say, more than half the window-width, you could fall back on the current wrapping.