forked from dariusf/synesthesia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew.py
More file actions
20 lines (16 loc) · 735 Bytes
/
new.py
File metadata and controls
20 lines (16 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import sublime, sublime_plugin
import os, tempfile, webbrowser
from . import templates
from . import compile
class SynesthesiaNewCommand(sublime_plugin.WindowCommand):
def run(self):
v = self.window.new_file()
v.settings().set('default_dir', compile.SYNESTHESIA_OUTPUT_PATH)
v.set_syntax_file('Packages/JavaScript/JSON.tmLanguage')
v.run_command("insert_snippet", {"contents": templates.new_file})
class SynesthesiaSampleCommand(sublime_plugin.WindowCommand):
def run(self):
v = self.window.new_file()
v.settings().set('default_dir', compile.SYNESTHESIA_OUTPUT_PATH)
v.set_syntax_file('Packages/JavaScript/JSON.tmLanguage')
v.run_command("insert_snippet", {"contents": templates.sample_file})