Can't search and replace trailing whitespace
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
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:
- In normal mode
- :%s/\s+$//g
- Status bar display error "E486: Pattern not found: \s+$".
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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