[Bug] `~` followed by an undo enters visual mode

Open
#196 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript
Domain
frontend

Research direction

Start with dev/web-demo.html and reproduce the sequence using ~ followed by CodeMirror's mod+z undo command. Trace how the vim emulator handles the case-change command and undo state, then verify that undo leaves normal mode with no selected text and that cursor movement does not expand a selection.

Written by the indexing model from the issue text.

Description

Steps to reproduce
  1. Go to https://raw.githack.com/replit/codemirror-vim/master/dev/web-demo.html
  2. In the normal mode, press ~ to invert the case of any character.
  3. Press mod+z to trigger CodeMirror's undo command. (do not use Vim's undo command u)
Expected result

The vim emulator stays in the normal mode, and no text is selected.

Actual result

It goes into the visual mode - in other words, the character under the cursor is selected. If you move the cursor using the arrow or hjkl keys, the selection will expand accordingly.

Dominant language
JavaScript
Stars
470
Forks
53
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from replit/codemirror-vim

All issues in replit/codemirror-vim

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.