1

I copy-pasted a batch file script from this SuperUser answer into Sublime Text 3, and had the following red line appear:

enter image description here

After some research and experimentation, this behaviour seems to be triggered by open quotes. Adding a " to the end of Line 6 gets rid of the red line, and adding a " on a separate line elsewhere in the script triggers another red line immediately after it, confirming this.

However, this still leaves two issues.

  1. I've been writing batch files in Sublime for a long time with this setup, so why has this behaviour only now surfaced - and how can I get rid of it?

  2. I can see no open quotes on Line 6 that could have triggered the red line. Have I missed something, or is this a glitch?

1 Answer 1

1

Sublime thinks the caret (^) is escaping the quotation marks next to it, so the line thinks you're short a matching ".

Note the slightly different colour in my editor:

enter image description here

Add & REM " to the end of the line, and it'll go away. FINDSTR doesn't use it as an escape, but other commands do.

3
  • I knew it was going to be something to do wth escape sequences. Thanks Silas. Also, unrelated, but can I ask how you were able to get such a high quality screenshot of code up close? Whenever I try I get a severely pixelated version. Aug 18, 2017 at 16:06
  • 1
    Not that you care anymore, but for historical record; I just pumped up my font size to a ridiculous number.
    – Silas B
    May 22, 2018 at 2:00
  • I appreciate you weighing in, it’s a useful trick to know. May 22, 2018 at 2:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .