Skip to content

Refine Vim-style e motion whitespace handling#11

Draft
Codex wants to merge 2 commits intocodex/implement-end-of-word-navigationfrom
codex/sub-pr-10
Draft

Refine Vim-style e motion whitespace handling#11
Codex wants to merge 2 commits intocodex/implement-end-of-word-navigationfrom
codex/sub-pr-10

Conversation

@Codex
Copy link

@Codex Codex AI commented Mar 5, 2026

e motion should stop at the current word end or the next word end when starting on whitespace; current behavior can skip past trailing whitespace to EOF.

  • Motion semantics: Rework moveWordEnd to respect initial character type, only skip whitespace when starting on it, and abort when no subsequent word exists.
  • Cursor safety: Prevent cursor from advancing past the last valid character when only trailing whitespace remains.

Example:

// Before: cursor on trailing spaces at end of text -> jumps past EOF
// After: cursor on trailing spaces -> no movement; cursor in word -> moves to word end
moveWordEnd(activeElement);

@Codex Codex AI changed the title [WIP] Add 'e' motion for word navigation Refine Vim-style e motion whitespace handling Mar 5, 2026
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.

2 participants