Set Tk selection anchor when using Home/End keys - #1923
Conversation
When used without Shift, Home/End (Cmd-Left/Right on Macs) should set the selection anchor so that future adjustment of the selection works more predictably. Fixes DistributedProofreaders#1920
|
This still does the wrong thing when (on Mac only) you move the cursor to start/end of line with Ctrl-A (start) or Ctrl-E (end). |
|
Strangely, though, it does work if you don't involve arrow keys in it! Works:
(The same is true in reverse: Ctrl-E, Shift-Ctrl-A, Shift-Ctrl-F.) Doesn't work:
This leaves the selection from where you clicked until just before the last char in the line. |
For the last bullet point, |
|
Yes |
|
The simple case now works. That is ...
Where arrow1 and arrow2 are left and right arrow keys (or right and left, depending on which direction the initial move is).
Confirmed this result of Dan's Also discovered another failure mode: If, when I click in the middle of a line, I have the shift key down and arrow to the left or the right, then catch myself and change from shift to cmd and go to one end of the line or the other, I see the same behavior as above (which mirrors the original problem). |
|
I'm not certain, since I can't test it, but hopefully this fixes the Ctrl-a/e problem. Please check they work as expected generally, not just this specific case. Also, please re-rest Cmd-left/right because the Ctrl-a/e fix slightly affects that too. @srjfoo if you test your second bug, that may have been fixed by this. If not, please can you describe it more precisely for me, specifically, what you expect to happen and what you see that is unexpected. I tested it as best I could on Windows, but couldn't do exactly what you describe of course. |
tangledhelix
left a comment
There was a problem hiding this comment.
The case I outlined earlier that didn't work, now works 👍🏻
The other case I mentioned, which was already working, still works too. LGTM!
When used without Shift, Home/End (Cmd-Left/Right on Macs) should set the selection anchor so that future adjustment of the selection works more predictably.
Fixes #1920