Skip to content

Set Tk selection anchor when using Home/End keys - #1923

Open
windymilla wants to merge 1 commit into
DistributedProofreaders:masterfrom
windymilla:selection-highlighting
Open

Set Tk selection anchor when using Home/End keys#1923
windymilla wants to merge 1 commit into
DistributedProofreaders:masterfrom
windymilla:selection-highlighting

Conversation

@windymilla

Copy link
Copy Markdown
Collaborator

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

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
@windymilla
windymilla requested a review from srjfoo August 9, 2026 14:36
@tangledhelix

Copy link
Copy Markdown
Member

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).

@tangledhelix

Copy link
Copy Markdown
Member

Strangely, though, it does work if you don't involve arrow keys in it!

Works:

  • Click in middle of some line
  • Ctrl-A to jump to start of line
  • Shift-Ctrl-E to select to end of line
  • Shift-Ctrl-B to move backward 1 char (selection is now entire line minus last character)

(The same is true in reverse: Ctrl-E, Shift-Ctrl-A, Shift-Ctrl-F.)

Doesn't work:

  • Click in middle of some line
  • Ctrl-A to jump to start of line
  • Shift-Cmd-Right to select to end of line
  • Shift-Cmd-Left to move backward 1 char

This leaves the selection from where you clicked until just before the last char in the line.

@srjfoo

srjfoo commented Aug 9, 2026

Copy link
Copy Markdown
Member

Doesn't work:

  • Click in middle of some line
  • Ctrl-A to jump to start of line
  • Shift-Cmd-Right to select to end of line
  • Shift-Cmd-Left to move backward 1 char

This leaves the selection from where you clicked until just before the last char in the line.

For the last bullet point, Shift-Cmd-Left should take you back to the beginning of the line. Did you mean Shift-Left?

@tangledhelix

Copy link
Copy Markdown
Member

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selection highlighting changes unpredictably when adjusting with Shift + Arrow keys

3 participants