Code block in new Beta

In the last Beta, the height of the code block was increased. I would like to know if it will be possible to disable this feature?

I have notes where I use a lot of code. And it is important/convenient for me to copy each line of code separately. In the stable version, it looks great. In the new Beta version, it looks terrible.

Dear developers! Give the option to disable this new feature so that the code block looks the same as before.


2 Likes

I suspect the reason for the change is to avoid the jarring editor experience when the block expands as the cursor is placed in the block — e.g. the block expands from a one-line to three-line display. AFAIK code blocks are the only markdown element in Bear that behave like this and use three+ lines (everything else is inline), so I guess they’re trying to have a more-uniform editor experience, which is important to their team & users.

The logic is clear to me. It also annoys me when a block of code expands when editing. The only way out of the situation would be what has already been done in the Beta version + the ability to copy each line separately. IMHO.

We’ve modified the code block to prevent the first and last rows from being hidden to prevent Cumulative Content Shift and enhance the overall “solid” editor experience.

I understand that this may not be ideal for your specific use case, but we believe that the feature is generally more beneficial for the majority of users.

We’re open to suggestions for improving the code blocks, but we’re actively trying to avoid adding more preferences, so that approach won’t be feasible for us.

1 Like

Hi!
Is it possible to add a copy of each line separately in the code block?

That would make it challenging to copy the entire code block. While it’s beneficial for your specific use case, I’m concerned that most users would find it annoying to add a button for each line.

Today, we’ll unveil the beta version to the public. Hopefully, we’ll receive more feedback on this. If the modifications cause more annoyances than benefits, we’ll revisit our approach.

2 Likes