Commit Graph

30 Commits

Author SHA1 Message Date
Kevin Ballard
81f9173138 Fix highlighting of nested tab stops
Nested tab stops like `${1:head ${2} tail}` were not properly
highlighting the "tail" or the closing `}` of the outer tab stop.
2014-08-05 17:21:35 -07:00
Matthias Bilger
79705c3fcc Ignore Errors E403 from included syntax files
This will silently discard Errors raised by syntax files that
are not designed to be included more than once.
2014-07-30 13:34:15 +02:00
Kevin Ballard
67c7422ae2 Set up basic highlighting for snipmate files
Try to detect a snipmate-formatted file by looking at the directory name
and searching for endsnippet. If we think it's a snipmate file, switch
over to an alternative syntax highlighting variant.
2014-06-30 21:14:55 -07:00
Kevin Ballard
40145103b6 Stop embedding python/viml/sh if the `` includes {
In order to handle brace balancing properly, we need our own region to
match the {/} pairs, which unfortunately means that if a { occurs in a
command substitution, we have to disable the embedded language
highlighting.
2014-06-30 20:10:42 -07:00
Kevin Ballard
010e2c4fac Remove the coloring for python commands
Python commands tend to be longer than normal commands, and they already
include embedded python syntax coloring, so coloring them red like shell
commands is a bit overwhelming.

Preferably there would be some subtle background color we could apply,
but I don't see any pre-existing group name for that, and defining our
own would not play well with colorschemes.
2014-06-30 19:29:00 -07:00
Kevin Ballard
ebd62751e7 Tweak snippet/global highlighting to always highlight the end
The snippet/global regions were always ending correctly, but an unclosed
contained region could cause the wrong highlighting to apply to the
endsnippet/endglobal. Tweak the definitions such that the snippet/global
regions actually end at the start of the line and the footer occurs
outside the region.
2014-06-30 19:26:28 -07:00
Kevin Ballard
30ecd1d1b0 Rewrite parsing for tab stops 2014-06-30 19:22:32 -07:00
Kevin Ballard
5fa39faa92 fixup! Clean up miscellaneous syntax items 2014-06-30 18:38:50 -07:00
Kevin Ballard
0dba6503e1 Clean up miscellaneous syntax items
Remove a few obsolete items.

Remove the snipTabsOnly item. A tab-only line is not necessarily an
error.

Color leading spaces with a red background, because the default Error
coloring doesn't affect the display of spaces.
2014-06-30 15:41:35 -07:00
Kevin Ballard
acc79747c9 Syntax highlight the snippet trigger properly
This supports multiword triggers, docstrings, options, and even
highlights invalid multiword triggers as errors.
2014-06-30 15:29:48 -07:00
Kevin Ballard
5760eb4033 Fix empty snippets/globals 2014-06-30 00:01:28 -07:00
Kevin Ballard
d239402b7f Rewrite syntax matching for global
The body of a global now only has Python syntax coloring if the trigger
is !p. This matches the actual behavior of UltiSnips. AFAIK right now
globals with other triggers are useless, but this opens the door to
proper syntax coloring for those if they ever gain a use.
2014-06-29 23:45:04 -07:00
Kevin Ballard
cb2905c178 Rewrite syntax matching for snippet 2014-06-29 23:33:36 -07:00
Kevin Ballard
5937cea081 Mark up syntax items with 'display' as appropriate 2014-06-29 23:22:53 -07:00
Kevin Ballard
b82759b250 Rewrite extends/priority/clearsnippets 2014-06-29 23:11:11 -07:00
Kevin Ballard
672117c478 Add hierarchy to syntax file
Redo comments with fold markers to provide an appropriate hierarchy to
the syntax file itself.
2014-06-29 23:04:37 -07:00
Kevin Ballard
739e3d94ad Fix coloring of shell/VimL/Python command substitutions
Include the sh syntax for shell commands.
Make the matching on !v/!p work more accurately.
Highlight the !v/!p separately from the embedded Python/VimL.

AFAIK the only issue now is that "\`" escapes inside shell/VimL/Python
are not treated as bare "`" characters by the embedded syntax, but I
don't believe there's any way to fix that.
2014-06-29 20:47:22 -07:00
Kevin Ballard
5b80ef187d Properly handle \` escapes in commands 2014-06-29 20:09:13 -07:00
Kevin Ballard
636546bebc Fix syntax name
b:current_syntax should be set to "snippets", as that's the filetype,
not "snippet".
2014-06-29 19:42:57 -07:00
Kevin Ballard
cab1509952 Fix embedded VimL highlighting
The b:current_syntax variable is set by syntax-include, so it needs to
be unset again or the second syntax-include does nothing.
2014-06-29 19:42:11 -07:00
Kevin Ballard
1ad7d54d75 Fix highlighting of Python/VimL commands
Also mark all the highlighting as default, so it can be overridden more
easily by the user.
2014-06-29 19:36:07 -07:00
Holger Rapp
c1b41d0fbf Adds 'priority' keyword and removes '!' option. 2014-02-19 21:04:52 +01:00
Holger Rapp
69194ed853 Added syntax highlighting for leading spaces, as they are most likely wrong. 2014-02-18 18:57:43 +01:00
Holger Rapp
584bee0ab1 Improvements to the syntax file. 2013-03-21 11:32:17 +01:00
Holger Rapp
b56e8991c7 Syntaxhighlighting for clearsnippets by Aaron Schrab 2012-11-24 10:12:36 +01:00
stardiviner
736698469e improve snipVar matches, like 10 100 etc 2012-08-15 14:15:37 +02:00
Holger Rapp
b0827fe3f6 Some improvements to Syntax highlighting including support for ${VISUAL} 2012-02-05 13:15:25 +01:00
Holger Rapp
3563b7a57f Added improvements to the syntax file by Anthony Jackson 2011-03-27 08:07:44 +02:00
Holger Rapp
b371f0c8c4 Updated syntax file by Timo Schmiade 2011-02-19 20:00:24 +01:00
Holger Rapp
c8fe2f4b02 Added a syntax file by Timo Schmiade. Made sure all shipped files are recognized as snippets, even when ftdetect is not in /Users/sirver 2011-02-17 14:07:27 +01:00