VSCodeVim / VSCodeVim/Vim

when using emmet wrap with abbreviation, cursor is not shown in correct position

Open
#3,186 0 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

Describe the bug
when in normal or visual mode, calling the emmet command "wrap with abbreviation" on a section of code will work, but the cursor is shown at the bottom of the new selection. When using movement commands like h,j,k,l, it becomes obvious that the cursor was where it originally was when the command was executed.

To Reproduce
Steps to reproduce the behavior:

  1. Select a few lines of html code with visual mode in a .html file
  2. enter command pallete with cmd + shift + p
  3. Type in 'wrap with abbreviation' and hit enter
  4. Type in "div" and hit enter to wrap your selection with a div
  5. Notice visually that your cursor is now at the bottom of the newly wrapped code
  6. Try to navigate using h,j,k,l, or arrow keys
  7. Notice the cursor hops to a different location within visual mode

Expected behavior
After code is wrapped, editor should correctly show where the cursor is located. editor should also exit visual mode

Screenshots

vscode_issue

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 0.16.12
  • VSCode version: 1.28.2
  • OS: OSX 10.12.6

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

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.

Research direction

Reproduce the issue in a .html file using visual mode and the “wrap with abbreviation” command from the command palette. Trace the command’s handling of the selection and cursor state, then verify with h, j, k, l or arrow-key movement that the cursor is displayed at its actual position and visual mode exits as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.