Fetching contributors…
Cannot retrieve contributors at this time
74 lines (68 sloc) 2.6 KB
require 'ruble'
bundle t(:bundle_name) do |bundle| = 'Jeremy Ashkenas, Christopher Williams'
bundle.contact_email_rot_13 = 'wnfuxranf@tznvy.pbz'
bundle.description = 'Coffeescript ruble ported from official Coffeescript Textmate bundle.'
# Folding
start_folding = /.*(->|=>)\s*$|.*[\[{]\s*$/
end_folding = /^\s*$|^\s*[}\]]\s*$/
bundle.folding[''] = start_folding, end_folding
# Indentation
decrease_indent = /^\s*(\}|\]|else|catch|finally)$/
increase_indent = /
|[a-zA-Z\$_](\w|\$|:|\.)*\s*(?=\:(\s*\(.*\))?\s*((=|-)>\s*$)) # function that is not one line
|[a-zA-Z\$_](\w|\$|\.)*\s*(?=(?!\::)\:(?!(\s*\(.*\))?\s*((=|-)>))):\s*((if|while)(?!.*?then)|for|$) # assignment using multiline if,while,for
bundle.indent[''] = increase_indent, decrease_indent
# Fallback to use our text editor if coffeescript editor isn't available
bundle.file_types[''] = '*.coffee', 'Cakefile' t(:bundle_name) do |main_menu| t(:run) do |submenu|
submenu.command t(:run)
submenu.command t(:compile_and_display_js)
submenu.command t(:run_selected_text)
end t(:control) do |submenu|
submenu.command t(:if)
submenu.command t(:if_else)
submenu.command t(:else_if)
submenu.command t(:ternary_if)
submenu.command t(:unless)
end t(:constructs) do |submenu|
submenu.command t(:new_function)
submenu.command t(:function)
submenu.command t(:bound_function)
submenu.command t(:array_comp)
submenu.command t(:object_comp)
submenu.command t(:range_comp_exclusive)
submenu.command t(:range_comp_inclusive)
submenu.command t(:switch)
submenu.command t(:class)
submenu.command t(:try_catch)
end t(:other) do |submenu|
submenu.command t(:heredoc_double_quotes)
submenu.command t(:heredoc_single_quotes)
submenu.command t(:heredoc_comment)
submenu.command t(:align_assignments)
submenu.command t(:raw_javascript)
submenu.command t(:require)
submenu.command t(:interpolated_code)
submenu.command t(:log)
# Set up the Comment ENV variables for coffeescript
env "" do |e|
e['TM_COMMENT_START'] = "# "
e['TM_COMMENT_START_2'] = "###"
e['TM_COMMENT_END_2'] = "###"
# Best guess as to set of pairs...
smart_typing_pairs[""] = ['"', '"', '(', ')', '{', '}', '[', ']', "'", "'", '`', '`']