From f04f61223574f4cb3fdf1e1e1491af2cbe5bbb0b Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Wed, 11 May 2011 18:27:50 -0400 Subject: [PATCH] Fix TextMate bundle for NVM users. --- build/carto.tmbundle/Commands/preview.tmCommand | 15 ++++++++++++--- build/vim-carto/syntax/carto.vim | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/build/carto.tmbundle/Commands/preview.tmCommand b/build/carto.tmbundle/Commands/preview.tmCommand index a00c7ba..d190c01 100644 --- a/build/carto.tmbundle/Commands/preview.tmCommand +++ b/build/carto.tmbundle/Commands/preview.tmCommand @@ -5,10 +5,19 @@ beforeRunningCommand nop command - # just to remind you of some useful environment variables -# see Help / Environment Variables for the full list + +#!/usr/bin/env ruby -"mapnik-render.js" "$TM_FILEPATH" "/tmp/test.png" +nvmdir = File.expand_path('~/.nvm') +if File.directory?nvmdir then + cartos = Dir.glob(nvmdir + '/*/bin/mapnik-render.js') + carto = cartos.pop() if cartos + node = carto.gsub('/bin/mapnik-render.js', '/bin/node') +end +if carto + `#{node} #{carto} #{ENV['TM_FILEPATH']} /tmp/test.png` +end + input none keyEquivalent diff --git a/build/vim-carto/syntax/carto.vim b/build/vim-carto/syntax/carto.vim index 3869157..a7c2e3f 100644 --- a/build/vim-carto/syntax/carto.vim +++ b/build/vim-carto/syntax/carto.vim @@ -47,7 +47,7 @@ syn region cartoFontDescriptorFunction contained matchgroup=cartoFunctionName st syn match cartoUnicodeRange contained "U+[0-9A-Fa-f?]\+" syn match cartoUnicodeRange contained "U+\x\+-\x\+" -syn match cartoKeywordAttr "/\|miter\|round\|bevel\|butt\|round\|square\|point\|line\|arrow\|ellipse\|png\|jpg\|svg\|normal\|grain_merge\|grain_merge2\|multiply\|multiply2\|divide\|divide2\|screen\|hard_light\|fast\|bilinear\|bilinear8\|centroid\|interior\|top\|middle\|bottom\|point\|line\|vertex\|interior\|none\|uppercase\|lowercase\|capitalize\|/" +syn match cartoKeywordAttr "/\|miter\|round\|bevel\|butt\|round\|square\|point\|line\|arrow\|ellipse\|local\|global\|normal\|grain_merge\|grain_merge2\|multiply\|multiply2\|divide\|divide2\|screen\|hard_light\|fast\|bilinear\|bilinear8\|centroid\|interior\|top\|middle\|bottom\|point\|line\|vertex\|interior\|none\|uppercase\|lowercase\|capitalize\|/" " syn keyword cartoColor contained {{#colors}}{{.}} {{/colors}} syn match cartoColor "/\|aliceblue\|antiquewhite\|aqua\|aquamarine\|azure\|beige\|bisque\|black\|blanchedalmond\|blue\|blueviolet\|brown\|burlywood\|cadetblue\|chartreuse\|chocolate\|coral\|cornflowerblue\|cornsilk\|crimson\|cyan\|darkblue\|darkcyan\|darkgoldenrod\|darkgray\|darkgreen\|darkgrey\|darkkhaki\|darkmagenta\|darkolivegreen\|darkorange\|darkorchid\|darkred\|darksalmon\|darkseagreen\|darkslateblue\|darkslategrey\|darkturquoise\|darkviolet\|deeppink\|deepskyblue\|dimgray\|dimgrey\|dodgerblue\|firebrick\|floralwhite\|forestgreen\|fuchsia\|gainsboro\|ghostwhite\|gold\|goldenrod\|gray\|grey\|green\|greenyellow\|honeydew\|hotpink\|indianred\|indigo\|ivory\|khaki\|lavender\|lavenderblush\|lawngreen\|lemonchiffon\|lightblue\|lightcoral\|lightcyan\|lightgoldenrodyellow\|lightgray\|lightgreen\|lightgrey\|lightpink\|lightsalmon\|lightseagreen\|lightskyblue\|lightslategray\|lightslategrey\|lightsteelblue\|lightyellow\|lime\|limegreen\|linen\|magenta\|maroon\|mediumaquamarine\|mediumblue\|mediumorchid\|mediumpurple\|mediumseagreen\|mediumslateblue\|mediumspringgreen\|mediumturquoise\|mediumvioletred\|midnightblue\|mintcream\|mistyrose\|moccasin\|navajowhite\|navy\|oldlace\|olive\|olivedrab\|orange\|orangered\|orchid\|palegoldenrod\|palegreen\|paleturquoise\|palevioletred\|papayawhip\|peachpuff\|peru\|pink\|plum\|powderblue\|purple\|red\|rosybrown\|royalblue\|saddlebrown\|salmon\|sandybrown\|seagreen\|seashell\|sienna\|silver\|skyblue\|slateblue\|slategray\|slategrey\|snow\|springgreen\|steelblue\|tan\|teal\|thistle\|tomato\|turquoise\|violet\|wheat\|white\|whitesmoke\|yellow\|yellowgreen\|transparent\|/" @@ -66,7 +66,7 @@ syn match cartoColor contained "#[0-9A-Fa-f]\{6\}\>" syn region cartoURL contained matchgroup=cartoFunctionName start="\