VSCodeVim / VSCodeVim/Vim

Special characters are not escaped properly in replace

Open
#2,700 0 comments 0 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

Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

What happened: Characters not getting escaped correctly in replace

What did you expect to happen: Special characters being properly escaped

How to reproduce it (as minimally and precisely as possible):

  • make a text file containing foo
  • vim command: %s/foo/"\\n"/g
  • This results in "\\n" getting placed into the file, not "\n". Curiously: %s/foo/"\n"/g works as intended (newlines are inserted into the file).

Environment:

  • Extension (VsCodeVim) version: 0.12.0
  • VSCode version: 1.23.1 (x64)
  • OS version: Windows 10 1803

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 %s/foo/"\\n"/g and %s/foo/"\n"/g commands in VSCodeVim with the reported VS Code and extension versions, then trace the substitution and escaping entry point. Done means replacement text preserves the intended escaped characters while still inserting newlines as expected.

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
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.