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.

Diff syntax highlighting doesn't work

See original GitHub issue

Hi, using Sublime Text 2.0.1 and latest version of your plugin, for some reason diff syntax highlighting isn’t working. 😦 When running diff, it says in the status bar:

Info: Invalid language: Diff. Available: JavaScript, ..., Line 13, Column 1

Checked Sublime Packages for Diff folder - it’s there. What may be the problem?

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
swillcommented, Sep 17, 2013

@jonaf: Thank you for this. It was exactly what I was looking for.

This is what I am using with the iPlastic theme:

        <dict>
            <key>name</key>
            <string>diff.header</string>
            <key>scope</key>
            <string>meta.diff, meta.diff.header</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string>italic</string>
                <key>foreground</key>
                <string>#0066FF</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>diff.deleted</string>
            <key>scope</key>
            <string>markup.deleted</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#C30D19</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>diff.inserted</string>
            <key>scope</key>
            <string>markup.inserted</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#009933</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>diff.changed</string>
            <key>scope</key>
            <string>markup.changed</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#FF8000</string>
            </dict>
        </dict>

Which looks like this: image

1reaction
jonafcommented, Jun 6, 2013

To make this work for other themes, the short-cut is to modify the *.tmTheme file for the theme you want to work, and copy over the diff definitions from the Monokai theme. I added this to my *.tmTheme file for the Wombat theme, and it works fine. (Note, you can change the hex values if you want to forcibly choose a different color scheme for diff specifically to better match your theme, i.e. if it’s a light-on-dark theme.)

        <dict>
            <key>name</key>
            <string>diff.header</string>
            <key>scope</key>
            <string>meta.diff, meta.diff.header</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#75715E</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>diff.deleted</string>
            <key>scope</key>
            <string>markup.deleted</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#F92672</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>diff.inserted</string>
            <key>scope</key>
            <string>markup.inserted</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#A6E22E</string>
            </dict>
        </dict>
        <dict>
            <key>name</key>
            <string>diff.changed</string>
            <key>scope</key>
            <string>markup.changed</string>
            <key>settings</key>
            <dict>
                <key>foreground</key>
                <string>#E6DB74</string>
            </dict>
        </dict>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Diff syntax highlighting in Github Markdown - Stack Overflow
I use the ```csharp to get csharp highlighting. I sometimes want to highlight something specific in the code using bold or anything. I...
Read more >
"diff" Syntax highlighting broken? - Atlassian Community
"diff" Syntax highlighting doesn't seem to work? Create a repo - commit and change, make a change, put the output of "git diff ......
Read more >
Syntax highlighting doesn't work in partial diff in Pull requests
Same issue is still present where full diff has correct syntax highlighting and partial diffs (snippets of code in the Files tab) don't....
Read more >
Syntax Highlighting Diffs In Code - Steven Hicks
Syntax Highlighting A Code Diff​​ Instead of specifying the programming language in the fenced code block, I can specify diff . Like the...
Read more >
Diff language does not highlight .diff or .patch files #80494
I've tried to view files in either diff or diff -u format, neither highlight within the VSCode editor window, despite the language being ......
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