florisboard: Smartbar copying/cutting doesn't fully copy long blocks of text

“Short” description

When copying or cutting long blocks of text using the smartbar’s Copy or Cut button, only a short portion of the text block gets copied. However, when copying or cutting short blocks of text, the text block is fully copied.

Sometimes, though, the clipboard becomes empty instead. Pasting (whether using the device’s builtin copying menu or the smartbar’s Paste button), then, would paste nothing.

The debug artifact that the bug first occurs in is PR #966’s artifact. The bug doesn’t occur in PR #963’s artifact.

The bug occurs regardless of the application used. I tested PR <span>#</span>966’s artifact as well as PR <span>#</span>963’s with three note-taking/text editing apps. In all three, the bug occurred for <span>#</span>966’s artifact but didn’t occur for <span>#</span>963’s artifact. If the need for testing arises, I’ve listed the three apps below.

The bug also doesn’t occur even if the smartbar’s Select All or Paste button was used along with the device’s builtin selection copying menu. The bug, then, seems to occur because of the copying/cutting mechanism of the keyboard itself and not because of its pasting or selecting-all mechanism.

I’m not certain whether this bug is the same bug as described in #1027 or #1083. However, there is past discussion of this bug in <span>#</span>1027, where <span>@</span>Glitchy-Tozier was unable to reproduce it in 0.3.13-beta06.

Long lorem ipsum (example long text block)
Est incidunt exercitationem reprehenderit ipsam expedita. Iusto aliquid ut quas inventore. Ex consequatur voluptatem quaerat quas dolor.

Et aut nobis laudantium explicabo aut ipsam quisquam debitis. Sint repellendus consequatur dicta est molestias fugit. Voluptatem quod velit est repellendus nobis rerum tempore. Expedita saepe non perferendis porro. Enim esse dicta velit. Dolores est tempora voluptas dolorem quis commodi distinctio assumenda.

A et at et. Dolore ad accusamus consequatur nihil debitis maxime animi. Ratione molestiae assumenda dolorem facere. Quae voluptatem quaerat magni et. Dolorem esse sed aut.

Voluptatem suscipit voluptatem mollitia officiis porro. Laudantium id dolorem molestias rem aperiam eos. Provident voluptas praesentium sunt reiciendis molestiae. Sint numquam similique earum animi dolorum eos. Eveniet dolorem natus est.

Vel omnis asperiores voluptatem enim eum ea quisquam. Numquam assumenda cupiditate sequi nostrum possimus blanditiis est. Explicabo necessitatibus sit rerum dignissimos voluptatem. Nemo maiores ipsa molestiae. Et non minus omnis esse facilis error doloribus sed. Quia modi harum omnis fugit expedita.

Molestiae qui officiis earum saepe ut. Assumenda et voluptas facere. Cupiditate dolores iste accusamus quia aliquam perferendis dolores beatae. Dolorem quo sint officia omnis. Magnam veritatis sit porro. Voluptatibus quos perspiciatis quam repellendus explicabo.

Ipsam repellendus deserunt in voluptas aut eveniet tempora omnis. Dolorum aut molestiae ut dolores quo officiis. Laboriosam autem dolorem est aut voluptatibus nihil. Quo fugit vero velit mollitia et rerum. Itaque et et pariatur impedit qui expedita tenetur ex. Autem nulla eum id aperiam architecto alias.

Similique quaerat molestias voluptatem cum. Inventore cum consequuntur dicta enim nobis eligendi facilis rerum. A praesentium delectus odio vero. Adipisci eos rerum doloribus quidem voluptate dolorem minus assumenda.

Reiciendis ut saepe quidem. Placeat dolor facilis neque aut voluptas. Commodi sit minima ex. Animi rerum ratione cupiditate consequuntur. Porro molestiae dolore deleniti. Sint praesentium cumque sunt ipsam amet voluptates ducimus.

Delectus omnis in nisi laborum saepe modi. Ad non sunt est rerum est. Illum itaque quae ipsam deleniti dolorem. Voluptas et libero optio eos ipsa. Sed possimus ut voluptate. Nihil perspiciatis nisi enim.
Remaining lorem ipsum portion after copy/cut and paste
 itaque quae ipsam deleniti dolorem. Voluptas et libero optio eos ipsa. Sed possimus ut voluptate. Nihil perspiciatis nisi enim.

(128 characters long, for some reason)

Apps used for testing

Steps to reproduce

  1. Go to a text box where typing is possible.
  2. Copy the example lorem ipsum text above and paste it into the text box using the device’s builtin copying menu.
  3. Select all of the text box’s text.
  4. Copy or cut the text using the keyboard’s Copy or Cut button in the smartbar. (The bug occurs with either copying or cutting.)
  5. Paste the text. (Using the keyboard’s Paste button is fine as it shouldn’t influence the resulting pasted text.)

Environment information

  • FlorisBoard Version: 0.3.13-debug (artifact from PR #966)
  • Install Source: GitHub
  • Android: 10

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 16 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Above PR #1154 should be a fix for the bug. I have just tested it out on my device and it seems to work. I will perform further testing though if it also works for some edge cases. <span>@</span>KLaurence or anyone interested: could you also try out the debug artifact if it works for you to confirm it’s fixed?

I love how well you put together your issues. 😃

Thanks for trying it out and confirming that it has been fixed! I will still wait at the responses of the mentioned users, but should nothing be mentioned until tomorrow I will merge the changes in, as I definitely want to have this fix in beta09 tomorrow.

One consistency the bug had was, that it always looked the same length when the cursor was at the end. So I copied some different long texts and noticed the hard limit of 128 characters before the cursor.

I can also reproduce this with the cursor at the very end.

Further confirming its relation, I just tried on my phone putting the cursor in the middle of a long block of text and then pressing the smartbar’s Select All button and then its Copy button. The keyboard copied 128 characters before the cursor (the same value as CACHED_TEXT_N_CHARS_BEFORE_CURSOR) and 48 characters after it (the same as CACHED_TEXT_N_CHARS_AFTER_CURSOR). Placing the cursor at the beginning only copied 48 characters. The videos I showed had the cursor at the very end so 128 characters before and none after it were copied.

Will look into possible fixes for the cut/copy bug tomorrow.

I see. I’ll keep an eye out for it!