#54 ✓resolved
zachriggle

Bug: PLIST Syntax Highlighting

Reported by zachriggle | December 24th, 2010 @ 07:23 AM | in 0.0.3

What I did

Open a .plist file.

What I expected to happen

XML syntax highlighting.

What actually happened

No syntax highlighting.

Remarks

I noticed that you use the hashbang to determine the file type (e.g., #!/bin/sh is a Shell file, even without an extension). Checking for a file whose first four non-space, non-XML-comment characters are <?xml would provide a similar heuristic for XML.

Free Regex Magic

If it matches this multi-line expression, it should be an XML file.

(([ \t\n]*)(<\!-{2,}.*?-{2,}>)([ \t\n]*))<\?xml

Note: The [ \t\n] chunk should be able to be replaced by \s, but for some reason egrep didn't like it.

Comments and changes to this ticket

  • rsms

    rsms December 26th, 2010 @ 08:28 PM

    • Milestone set to 0.0.3
    • State changed from “new” to “resolved”
    • Assigned user set to “rsms”
    • Tag set to syntaxhighlight, xml
    • Milestone order changed from “36” to “0”

    Kod currently only looks at the first line of the file (but does trim leading whitespace and newlines), so I've use a simple regular expression:

    ^<\?xml
    

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

A text editor for Mac OS X

People watching this ticket

Pages