VSCodeVim / VSCodeVim/Vim

Can't search and replace trailing whitespace

Open
#3,058 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
Trying to do a substitution to delete trailing whitespace (:%s/\s+$//g). Executing the command does not delete trailing whitespace, but generates an error, and leaves the file modified. This works in vim, but VSCodeVim generates the error "E486: Pattern not found: \s+$"

To Reproduce
Steps to reproduce the behavior:

  1. In normal mode
  2. :%s/\s+$//g
  3. Status bar display error "E486: Pattern not found: \s+$".
  4. VSCode shows the file as being modified, but no changes have been made.

Expected behavior
Execute step 1 and step 2 and it deletes trailing spaces.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 0.16.4
  • VSCode version: 1.27.2
  • OS: Windows 10, Build 1709.

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 :%s/\s+$//g in VSCodeVim using the versions and Windows environment listed in the report, then compare its behavior with Vim. Trace the substitution command's pattern matching and replacement handling; done means trailing whitespace is removed without E486 and the file is only marked modified when changes occur.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.