Copy to clipboard in lister now works every time
ClosedPublic

Authored by martinkostolny on Apr 10 2016, 1:31 AM.

Details

Reviewers
asensi
gengisdave
Group Reviewers
Krusader
Maniphest Tasks
T1970: Various Lister Issues
Summary

When selecting text in lister and pressing Ctrl+c, sometimes selected text does not make it to the clipboard leaving the old clipboard contents as is.

This patch should fix this behaviour. Copying to clipboard is handled differently in lister then in standard editor because lister is simulating a big scrollable textarea. So every way of selecting text must be handled separately to store "anchor" and "position". According these two variables copying to clipboard can be done afterwards.

Test Plan

I believe I've tested all possible scenarios how to select a text to copy it to clipboard afterwards. My tests were:

  • mouse only selection (left->right, up->down)
  • mouse only selection (right->left, down->up)
  • keyboard only selection (left->right, up->down)
    • with keys shift+right/down/end/pgdown, shift+ctrl+right/down/end/pgdown
  • keyboard only selection (right->left, down->up)
    • with keys shift+left/up/home/pgup, shift+ctrl+left/up/home/pgup
  • shift+mouse-click

Diff Detail

Repository
R167 Krusader
Lint
Lint Skipped
Unit
Unit Tests Skipped
martinkostolny retitled this revision from to Copy to clipboard in lister now works every time.
martinkostolny updated this object.
martinkostolny edited the test plan for this revision. (Show Details)
martinkostolny set the repository for this revision to R167 Krusader.
martinkostolny added a reviewer: Krusader.
martinkostolny added a project: Krusader.
asensi accepted this revision.EditedApr 10 2016, 11:10 PM
asensi added a reviewer: asensi.
asensi added a subscriber: asensi.

Great!

Although trying it, in a binary file, sometimes I selected text with the mouse from bottom to top, and then I pressed Ctrl+Shift+left but the cursor went to the right, and vice versa; but anyway it happened only occasionally, maybe it's a local little problem, and anyway the work of Martin left Lister much better than it was!

This revision is now accepted and ready to land.Apr 10 2016, 11:10 PM

Thanks a lot for your review, Toni! Unfortunately I'm unable to replicate the issue You mentioned. I'm going to commit the change and work on other issues in lister and we'll see if the other fixes fix (or expose more) the problem with ctrl+shift+arrow after mouse selection.

Or maybe I should wait for Davide's review? As I'm still a rookie I'm not sure what's the proper commit workflow for Krusader. Something tells me I should wait for at least for 2 "ship it" reviews, right?

Thanks a lot for your review, Toni! Unfortunately I'm unable to replicate the issue You mentioned. I'm going
to commit the change and work on other issues in lister and we'll see if the other fixes fix (or expose more) the
problem with ctrl+shift+arrow after mouse selection.

That's good! I accepted the revision because the problem was not reproducible, it looked like it had nothing to do with your changes, etc. and so I thought that the code would be in a better state after your changes. I keep thinking that :-)

Or maybe I should wait for Davide's review? As I'm still a rookie I'm not sure what's the proper commit workflow
for Krusader. Something tells me I should wait for at least for 2 "ship it" reviews, right?

I think the same, if there are two reviewers that accept one revision, that's better. Although if too much time passes, it looks like one "ship it" review is better than having it stalled; what is "too much time"?, maybe (because one Krusader developer may be too busy) it's more than a week? I haven't seen it formally stated :-)

I agree, 1-2 weeks seams reasonable. Thanks! :)

gengisdave accepted this revision.Apr 12 2016, 6:52 PM
gengisdave added a reviewer: gengisdave.
gengisdave added a subscriber: gengisdave.

I agree with both of you, as time passes, less "accept" are required. During the week, my work eats most of my time and I don't have too much time to test patches, instead I have time to test for regressions.

That's fine of course! This is free-time activity for me, too :). So sometimes I have no time at all.

Thanks, shipped!