emacs-evil / emacs-evil/evil

In subword-mode, `w` navigation stops moving forward on the first line

Open
#779 17 comments 0 reactions 0 assignees View on GitHub
bug minor
Dominant language
Emacs Lisp
Stars
3.9k
Forks
307
PR merge metrics
No merged PRs in 30d

Description

### Description
A specific order of upper and lowercase characters like: `ACoupleOfCamelCaseWords`, on a buffers first line causes the cursor to stop moving forward when w is pressed, while `subword-mode` is enabled.

### Steps to reproduce

1. Start Emacs + Evil or Spacemacs
2. Open a new buffer C-f b, type: `new`, press RET
3. On the first line of the buffer type: `ACoupleOfCamelCaseWords`
4. Move the cursor to the first `A`
5. Enable subword mode M-x, type: `subword-mode`, press RET
6. Press w

### Observed behavior
The cursor jumps to the `e` in `Couple`. Then nothing happens when w is pressed again.

### Expected behavior
The cursor shouldn't stop moving forwards.

### Notes
If one moves the cursor forward one character l then w continues moving forward. But if the cursor is anywhere before the `e` in `ACouple` then the cursor jumps to and stops at the `e`.

The same thing happens with: `AAAAAaaaaaaaaaaaAaa`. The order of upper and lowercase characters seems to be:
Two or more uppercase characters at the start, then one or more lowercase characters followed by an uppercase character.

The cursor stops on the last lowercase character before the third uppercase character. It doesn't seem to matter how many lowercase `a`'s there are, a quick test with 3360 `a`'s caused the same thing to happen.

It only happens on the buffers first line, if the same word/characters are on any other line, then w keeps moving forward as expected.

### Tested
This happens with just Emacs and the Evil package and in Spacemacs:

#### System Info :computer:
- OS: windows-nt
- Emacs: 25.1.1
- Spacemacs: 0.200.7
- Spacemacs branch: develop (rev. 3072e727)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
```elisp
(helm auto-completion emacs-lisp git)
```
- System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure in Evil with Emacs `subword-mode` enabled, comparing `w` navigation on the first line with the same text on later lines. Trace the entry point for Evil's `w` motion and the interaction with `subword-mode`; done means repeated `w` presses continue moving forward through the reported uppercase/lowercase patterns.

Written by the indexing model from the issue text.

Assessment

Tech stack
emacs, emacs-lisp
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.