Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update git-config syntax for double quotes. #16

Closed
wants to merge 2 commits into from

2 participants

@joshuajabbour

The gitconfig syntax improperly highlights escaped double quotes. Escaping quotes is sometimes necessary (as in mergetool.cmd and others), but when it's done, the highlighting gets borked for the rest of the file.

gitconfig-syntax-bad

With the changes in ca2c590 this is no longer the case. Also notice the properly highlighted "upstream" in both images (what the regex is specifically trying to capture).

gitconfig-syntax-good

Commit ca2c590 isn't necessarily relevant to this fix, but per http://git-scm.com/docs/git-config#FILES is an acceptable file path.

@infininight infininight referenced this pull request from a commit
@infininight infininight Add proper escapes to unquoted string values
This fixes the issue in #16 where you may need to use a quote character without starting a quoted string context. Allowable escapes taken from http://git-scm.com/docs/git-config#FILES
c2a675a
@infininight
Owner

Pulled 1ff4945, rather than a look-behind to detect invalid strings I added the proper escapes to unquoted string values in c2a675a. Thanks!

@infininight infininight closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 Syntaxes/Git Config.tmLanguage
View
5 Syntaxes/Git Config.tmLanguage
@@ -5,6 +5,7 @@
<key>fileTypes</key>
<array>
<string>.git/config</string>
+ <string>git/config</string>
<string>.gitconfig</string>
<string>etc/gitconfig</string>
<string>.gitmodules</string>
@@ -110,7 +111,7 @@
<key>string</key>
<dict>
<key>begin</key>
- <string>"</string>
+ <string>(?<!\\)"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
@@ -120,7 +121,7 @@
</dict>
</dict>
<key>end</key>
- <string>"</string>
+ <string>(?<!\\)"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
Something went wrong with that request. Please try again.