Bear Beta update: Someone looking for the Copy Code button?

We hear you, coders! Now you can easily copy code snippets in Bear… as many times as you want! :fire:

The Copy Code button has been added to the folding button area. The button will only appear when you hover on the side of the editor, just like the folding buttons. Here’s a video to show you how satisfying clicking the button feels. :star_struck: Try it now and tell us what you think!

Note: When performed inside a code block, ⌘A selects the block content only. A second ⌘A selects all the note content.

Happy Copy!

————————

Bear Beta version (2.2.0 12671) full changelog:

  • A Copy Code button has been added to the folding area next to the code block
  • PDF export fixes for code blocks overlapping pages
  • Folding icons now scale with the text
  • Improvements to the Sonoma flickering issue
  • Fixed issue with links and DOCX exports
  • Fixed issues with the Obsidian importers
9 Likes

I’m not a coder, but I appreciate this, as I sometimes will keep unformatted text this way. And a copy button is awesome!

2 Likes

Is it also available with normal code (single accent key)?

This is great!! Thank you!

It seems to only work for full code-blocks.

Thank you, I find it very useful! Initially, I struggled to find the “copy code” button because I was looking for it in the top right corner :grin:

Anyway, everything seems perfect to me.

1 Like

No, it only works for code blocks not inline code. :technologist:

I like that it’s in the gutter and not cluttering up the code block itself. (When the button is in the code block, it often covers up the code itself. Putting it in the gutter is much better. Props!)

Could be wrong, but it looks like the buttons appear instantly. Not ideal. That can cause the buttons to flicker in and out of existence as the user passes the mouse over the folding button area to a different destination.

You can prevent that by adding a small delay (50ms?) between mouse hover and when the code copy button and the folding buttons appear.

As an example, Sublime Text’s folding buttons work exactly like this (slight delay). Keeps the UI peaceful.

I made a short video of what I mean. Notice that the fold icon only appears when I’m intentional about placing my mouse in the gutter.

CleanShot 2024-05-31 at 21.26.11