Skip to content

move_word is inconsistent on last letter of a word #7353

@sgrj

Description

@sgrj

This affects the master version, and manifests in different ways.

  1. Pressing alt-d on the last letter of a word deletes the last letter and the trailing whitespace, whereas alt-d on any other letter only deletes until the end of the word. E.g., given
abc def

when the cursor is on c, then alt-d results in

abdef

while when the cursor is on b, then alt-d results in

a def
  1. Using the w motion in vi mode on the last letter of a word moves the cursor to the second letter of the next word, whereas w on any other letter moves to the first letter of the next word. E.g., given
abc def

when the cursor is on c, then w moves the cursor to e, while when the cursor is on a or b, then w moves the cursor to d.

  1. This is also the root cause for vi binding 'e' has wrong behaviour on second-to-last char #4025 (the description there is outdated: after ce65709, when the cursor is on 1 in 12 345, the cursor moves to the space, but it should move to the 2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions