editor:select-to-end-of-line should work similarly to editor:move-to-end-of-line

I’d normally use the Shift + End buttons to select the text from the current cursor position to the end of the line, but this doesn’t seem to be working with Atom.

Let’s say I have this long line:

This is a very long line of text that is used to test a bug report in Atom.

Now let’s say I resize Atom’s window so the line can’t fit in a single row, specifically, the text port in Atom. is forced on a new row.

Now, I’d expect that if I place the cursor at the beginning of the line and hit Shift + End, the entire text is selected. I’d even accept as a reasonable behavior if Atom selects everything up to the test a bug re part, but that is not the case. Atom is actually selecting everything on the first row of the line, except the last character. That is, in my example, after placing the cursor at the beginning of the line and hitting Shift + End, Atom is selecting this:

This is a very long line of text that is used to test a bug r

3 thoughts on “editor:select-to-end-of-line should work similarly to editor:move-to-end-of-line

  1. I see a similar behavior when using the end key. This is bound to editor:move-to-end-of-screen-line by default. Adding a custom keybinding as follows changes the the behavior as desired:
    'atom-text-editor':
    'end': 'editor:move-to-end-of-line'

    The shift-end keybinding is bound to editor:select-to-end-of-line. Looking at the command names I’d expect editor:move-to-end-of-line and editor:select-to-end-of-line to behave the same way, but it does not.

    Suggested fix

    • Rename editor:select-to-end-of-line to editor:select-to-end-of-screen-line.
    • Implement new command editor:select-to-end-of-line with similar behavior as editor:move-to-end-of-line
    • (Optional) Assign default keybinding shift-end to editor:select-to-end-of-screen-line to keep current default behavior.
  2. By the way, I’m using the config below now, I think it’s self-descriptive:

    'atom-text-editor':
        'alt-home': 'editor:move-to-beginning-of-line'
        'alt-end': 'editor:move-to-end-of-line'
        'alt-shift-home': 'editor:select-to-beginning-of-line'
        'alt-shift-end': 'editor:select-to-end-of-line'