question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Substitute backslash inconsistency

See original GitHub issue

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

What happened: When using substitute, the backslash character is not handled correctly. Typing in \\ will print out “\” instead of only one ""

This wasn’t really a problem until I ran into a case where I have to separate in “\right”. If I use :s/[find pattern]/\right/gc I end up with the return command being used. The output is therefore “ight” on the next line.

If I use :s/[find pattern]/\\right/gc, it will simply output “\right” which isn’t what I wanted either.

What did you expect to happen: :s/[find pattern]/\\right/gc to replace “\right” into the corresponding matches.

Note: the : is simply there for effect. I’m not entering : into the command box that pops up.

Environment:

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
msdriggcommented, Mar 5, 2021

This is still an issue for me.

0reactions
prmichaelsencommented, Aug 27, 2018

I’ll give it a try and report back

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can someone explain the strange behavior of backslash in ...
The documented behaviour of backslashes in backtick-style command substitution is: When the old-style backquote form of substitution is used ...
Read more >
Search & replace back slashes to forward slashes in windows
find a backslash, followed by at least 1 character that is not a backslash, and replace with a forward slash followed by the...
Read more >
I try to replace the backward slash with forward slash using ...
I try to replace the backward slash with forward slash using gsub but it's not working · 1 · Yes, that was acting...
Read more >
Substitution (sed & awk, Second Edition)
The first substitute command replaces ".Ah" with two newlines and "@A HEAD =". A backslash at the end of the line is necessary...
Read more >
Dodekalogue - the Tcler's Wiki!
If a backslash (“\”) appears within a word then backslash substitution occurs. In all cases but those described below the backslash is dropped...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found