Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 74 lines (68 sloc) 2.659 kb
87f2bc1 @sgtcoolguy initial port
sgtcoolguy authored
1 require 'ruble'
2
1685afd @sgtcoolguy Externalize UI strings
sgtcoolguy authored
3 bundle t(:bundle_name) do |bundle|
87f2bc1 @sgtcoolguy initial port
sgtcoolguy authored
4 bundle.author = 'Jeremy Ashkenas, Christopher Williams'
5 bundle.contact_email_rot_13 = 'wnfuxranf@tznvy.pbz'
1685afd @sgtcoolguy Externalize UI strings
sgtcoolguy authored
6 bundle.description = 'Coffeescript ruble ported from official Coffeescript Textmate bundle.'
87f2bc1 @sgtcoolguy initial port
sgtcoolguy authored
7 # Folding
8 start_folding = /.*(->|=>)\s*$|.*[\[{]\s*$/
9 end_folding = /^\s*$|^\s*[}\]]\s*$/
10 bundle.folding['source.coffee'] = start_folding, end_folding
11
12 # Indentation
13 decrease_indent = /^\s*(\}|\]|else|catch|finally)$/
14 increase_indent = /
15 ^\s*
16 (.*class
17 |[a-zA-Z\$_](\w|\$|:|\.)*\s*(?=\:(\s*\(.*\))?\s*((=|-)>\s*$)) # function that is not one line
18 |[a-zA-Z\$_](\w|\$|\.)*\s*(?=(?!\::)\:(?!(\s*\(.*\))?\s*((=|-)>))):\s*((if|while)(?!.*?then)|for|$) # assignment using multiline if,while,for
19 |(if|while)(?!.*?then)|for
20 |.*[-=]>$
21 |.*[\{\[]$)/x
22 bundle.indent['source.coffee'] = increase_indent, decrease_indent
23 # Fallback to use our text editor if coffeescript editor isn't available
24 bundle.file_types['source.coffee'] = '*.coffee', 'Cakefile'
25
1685afd @sgtcoolguy Externalize UI strings
sgtcoolguy authored
26 bundle.menu t(:bundle_name) do |main_menu|
27 main_menu.menu t(:run) do |submenu|
28 submenu.command t(:run)
29 submenu.command t(:compile_and_display_js)
30 submenu.command t(:run_selected_text)
87f2bc1 @sgtcoolguy initial port
sgtcoolguy authored
31 end
1685afd @sgtcoolguy Externalize UI strings
sgtcoolguy authored
32 main_menu.menu t(:control) do |submenu|
33 submenu.command t(:if)
34 submenu.command t(:if_else)
35 submenu.command t(:else_if)
36 submenu.command t(:ternary_if)
37 submenu.command t(:unless)
87f2bc1 @sgtcoolguy initial port
sgtcoolguy authored
38 end
1685afd @sgtcoolguy Externalize UI strings
sgtcoolguy authored
39 main_menu.menu t(:constructs) do |submenu|
40 submenu.command t(:new_function)
41 submenu.command t(:function)
42 submenu.command t(:bound_function)
43 submenu.command t(:array_comp)
44 submenu.command t(:object_comp)
45 submenu.command t(:range_comp_exclusive)
46 submenu.command t(:range_comp_inclusive)
47 submenu.command t(:switch)
48 submenu.command t(:class)
49 submenu.command t(:try_catch)
87f2bc1 @sgtcoolguy initial port
sgtcoolguy authored
50 end
1685afd @sgtcoolguy Externalize UI strings
sgtcoolguy authored
51 main_menu.menu t(:other) do |submenu|
52 submenu.command t(:heredoc_double_quotes)
53 submenu.command t(:heredoc_single_quotes)
54 submenu.command t(:heredoc_comment)
55 submenu.command t(:align_assignments)
56 submenu.command t(:raw_javascript)
57 submenu.command t(:require)
58 submenu.command t(:interpolated_code)
59 submenu.command t(:log)
87f2bc1 @sgtcoolguy initial port
sgtcoolguy authored
60 end
61 end
62 end
63
64 # Set up the Comment ENV variables for coffeescript
65 env "source.coffee" do |e|
66 e['TM_COMMENT_START'] = "# "
67 e['TM_COMMENT_START_2'] = "###"
68 e['TM_COMMENT_END_2'] = "###"
69 e.delete('TM_COMMENT_END')
70 end
71
72 # Best guess as to set of pairs...
73 smart_typing_pairs["source.coffee"] = ['"', '"', '(', ')', '{', '}', '[', ']', "'", "'", '`', '`']
Something went wrong with that request. Please try again.