-
-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smartbar copying/cutting doesn't fully copy long blocks of text #1146
Comments
I love how well you put together your issues. :) |
Yeah that's right the copy/cut and pasting function on the smartbar doesn't work correctly i always using the system copy and cut functions by long pressing of the text i wish that this annoying bug get fix on newer versions because i love this keyboard app don't wana change it to other keyboards. |
Thanks for your extensive bug report regarding this issue, I really appreciate the read!
#966 was merged in-between beta02 and beta03, also in #1027 (comment) you mention the cut bug occurs in beta03. So I did compare the changes beta03 introduced (they mostly came from #966 anyways). Summarized: the internal editor instance was reworked, the keyboard state register introduced, updates to the UI redraw mechanism, service names surfacing the system were abstracted, etc., although nothing specific why the cut/copy feature is broken all of a sudden.
Now before I can do more debugging and assumptions, it is important for me to know: do you use the internal clipboard or use the system clipboard as clip-data storage (Settings > Keyboard > Group clipboard)? Also if using the internal one, do you allow syncing from/to the system clipboard? The state of these preferences can decide if this or that logic is applied to copying and helps me a lot in setting up the exact environment to trace the faulty behavior.
#1083 is definitely the same, #1027 also I think. As this issue provides the most info at once though, this is the issue I will use until the bug is resolved, the others will be closed with a reference to this one. |
When I wrote the initial issue, the "Use internal clipboard" option was turned off. Testing every combination of the "Use internal clipboard", "Sync from internal clipboard", and "Sync to internal clipboard" options, the bug still occurs. |
Here is a video of the bug. Notice how the full example lorem ipsum text is pasted fully the first time. After copying and then pasting again, the text is incomplete. Florisboard-copying_internal-clipboard-disabled.mp4Here is also a video of the bug not occurring when the copied text is short. Florisboard-copying_internal-clipboard-disabled-short-text-block.mp4 |
Thanks for the screen shares! I played around on my device and got the copy bug immediately. It is the same across all apps, so it is a problem within FlorisBoard. 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 searched the code base for 128 and immediately came across these two lines: florisboard/app/src/main/java/dev/patrickgold/florisboard/ime/core/EditorInstance.kt Lines 809 to 810 in a356585
which are used to limit the cached text to improve the performance. And looking at the limits these are also the limits for cut/copy. I am too tired now to do extensive debugging, but I guess the cut/copy use the cached input rather than the intended |
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
I see. I'll keep an eye out for it! |
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. @KLaurence or anyone interested: could you also try out the debug artifact if it works for you to confirm it's fixed? |
Copying and cutting works properly for me in the debug artifact. I'll mention some people that might be interested (but don't hesitate to try out the artifact if I didn't mention you): @GoRaN909, you've mentioned that copying and cutting also doesn't work for you. Can you check if PR #1154's debug artifact fixes the problem? @Atrate, you've added a +1 reaction to the main comment. Assuming (purely based on that +1) that this problem also occurs for you, can you also check the debug artifact and see if your problem is also fixed? @mistery, you created issues #1027 and #1083 which Patrick has closed in favor of this issue because of their similarity. Can you also check if the debug artifact fixes the problem for you? (I have only known how to download artifacts recently, so, if anyone would also like to know, the debug artifact can be found at the PR's page > Checks > Artifacts.) |
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. |
Thanks everyone for the effort. I only have access to a phone for the next couple of days. |
Direct artifact link: Edit: just tried out the link on mobile and it does not work, check out https://github.com/florisboard/florisboard/pull/1154/checks and then on the very-mobile friendly page Atrifacts > app-debug.apk |
Thanks, Patrick. It worked when I clicked the link in the email. I can confirm that pasting seems to work fine now. |
Yes the bug was fixed for me i tested the debug version now copy/cut is works using smartbar buttons also the copied text shows correctly on the clipboard manager it's not empty. Thanks for both of you :) |
Glad the problem's also fixed for both of you! @patrickgold, thank you for fixing this bug! I'll keep the issue open in case something arises, but feel free to close it when you merge the PR into master. |
Thanks to all of you for testing out the fix, will merge them into master, so it is included in today's beta09 release.
This issue is linked to the PR, means as soon as I merge the PR in GitHub will auto-close this issue for me. |
"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 #966's artifact as well as PR #963's with three note-taking/text editing apps. In all three, the bug occurred for #966's artifact but didn't occur for #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 #1027, where @Glitchy-Tozier was unable to reproduce it in 0.3.13-beta06.
Long lorem ipsum (example long text block)
Remaining lorem ipsum portion after copy/cut and paste
(128 characters long, for some reason)
Apps used for testing
Steps to reproduce
Environment information
The text was updated successfully, but these errors were encountered: