Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/tanepiper/SublimeText-Nodejs
Browse files Browse the repository at this point in the history
Conflicts:
	Nodejs.sublime-completions
  • Loading branch information
Iuri Aranda committed Apr 25, 2013
2 parents 02ec302 + 86a16f8 commit a4d1eb1
Show file tree
Hide file tree
Showing 10 changed files with 449 additions and 427 deletions.
6 changes: 5 additions & 1 deletion Default (Linux).sublime-keymap
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[
{"keys": ["alt+r"], "command": "node_run"},
{"keys": ["alt+r"], "command": "node_run", "context":
[
{ "key": "setting.is_widget", "operator": "equal", "operand": false }
]
},
{"keys": ["alt+d"], "command": "node_drun"},
{"keys": ["ctrl+alt+r"], "command": "node_run_arguments"},
{"keys": ["ctrl+alt+d"], "command": "node_drun_arguments"}
Expand Down
6 changes: 5 additions & 1 deletion Default (Windows).sublime-keymap
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[
{"keys": ["alt+r"], "command": "node_run"},
{"keys": ["alt+r"], "command": "node_run", "context":
[
{ "key": "setting.is_widget", "operator": "equal", "operand": false }
]
},
{"keys": ["alt+d"], "command": "node_drun"},
{"keys": ["ctrl+alt+r"], "command": "node_run_arguments"},
{"keys": ["ctrl+alt+d"], "command": "node_drun_arguments"}
Expand Down
28 changes: 16 additions & 12 deletions Nodejs.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,33 +153,37 @@ def run(self, edit):

def command_done(self, result):
s = sublime.load_settings("Nodejs.sublime-settings")
if s.get('ouput_to_new_tab'):
if s.get('output_to_new_tab'):
self.scratch(result, title="Node Output", syntax="Packages/JavaScript/JavaScript.tmLanguage")
else:
self.panel(result)

# Command to Run node
class NodeRunCommand(NodeTextCommand):
def run(self, edit):
command = """kill -9 `ps -ef | grep node | grep -v grep | awk '{print $2}'`"""
os.system(command)
command = ['node', self.view.file_name()]
self.run_command(command, self.command_done)

def command_done(self, result):
s = sublime.load_settings("Nodejs.sublime-settings")
if s.get('ouput_to_new_tab'):
if s.get('output_to_new_tab'):
self.scratch(result, title="Node Output", syntax="Packages/JavaScript/JavaScript.tmLanguage")
else:
self.panel(result)

# Command to run node with debug
class NodeDrunCommand(NodeTextCommand):
def run(self, edit):
command = """kill -9 `ps -ef | grep node | grep -v grep | awk '{print $2}'`"""
os.system(command)
command = ['node', 'debug', self.view.file_name()]
self.run_command(command, self.command_done)

def command_done(self, result):
s = sublime.load_settings("Nodejs.sublime-settings")
if s.get('ouput_to_new_tab'):
if s.get('output_to_new_tab'):
self.scratch(result, title="Node Output", syntax="Packages/JavaScript/JavaScript.tmLanguage")
else:
self.panel(result)
Expand Down Expand Up @@ -212,7 +216,7 @@ def on_input(self, message):

def command_done(self, result):
s = sublime.load_settings("Nodejs.sublime-settings")
if s.get('ouput_to_new_tab'):
if s.get('output_to_new_tab'):
self.scratch(result, title="Node Output", syntax="Packages/JavaScript/JavaScript.tmLanguage")
else:
self.panel(result)
Expand All @@ -228,7 +232,7 @@ def on_input(self, message):

def command_done(self, result):
s = sublime.load_settings("Nodejs.sublime-settings")
if s.get('ouput_to_new_tab'):
if s.get('output_to_new_tab'):
self.scratch(result, title="Node Output", syntax="Packages/Text/Plain text.tmLanguage")
else:
self.panel(result)
Expand All @@ -239,7 +243,7 @@ def run(self, edit):

def command_done(self, result):
s = sublime.load_settings("Nodejs.sublime-settings")
if s.get('ouput_to_new_tab'):
if s.get('output_to_new_tab'):
self.scratch(result, title="Node Output", syntax="Packages/Text/Plain text.tmLanguage")
else:
self.panel(result)
Expand All @@ -256,7 +260,7 @@ def on_input(self, message):

def command_done(self, result):
s = sublime.load_settings("Nodejs.sublime-settings")
if s.get('ouput_to_new_tab'):
if s.get('output_to_new_tab'):
self.scratch(result, title="Node Output", syntax="Packages/Text/Plain text.tmLanguage")
else:
self.panel(result)
Expand All @@ -273,7 +277,7 @@ def on_input(self, message):

def command_done(self, result):
s = sublime.load_settings("Nodejs.sublime-settings")
if s.get('ouput_to_new_tab'):
if s.get('output_to_new_tab'):
self.scratch(result, title="Node Output", syntax="Packages/Text/Plain text.tmLanguage")
else:
self.panel(result)
Expand All @@ -284,7 +288,7 @@ def run(self, edit):

def command_done(self, result):
s = sublime.load_settings("Nodejs.sublime-settings")
if s.get('ouput_to_new_tab'):
if s.get('output_to_new_tab'):
self.scratch(result, title="Node Output", syntax="Packages/Text/Plain text.tmLanguage")
else:
self.panel(result)
Expand All @@ -295,7 +299,7 @@ def run(self, edit):

def command_done(self, result):
s = sublime.load_settings("Nodejs.sublime-settings")
if s.get('ouput_to_new_tab'):
if s.get('output_to_new_tab'):
self.scratch(result, title="Node Output", syntax="Packages/Text/Plain text.tmLanguage")
else:
self.panel(result)
Expand All @@ -306,7 +310,7 @@ def run(self, edit):

def command_done(self, result):
s = sublime.load_settings("Nodejs.sublime-settings")
if s.get('ouput_to_new_tab'):
if s.get('output_to_new_tab'):
self.scratch(result, title="Node Output", syntax="Packages/Text/Plain text.tmLanguage")
else:
self.panel(result)
Expand All @@ -319,7 +323,7 @@ def run(self, edit):

def command_done(self, result):
s = sublime.load_settings("Nodejs.sublime-settings")
if s.get('ouput_to_new_tab'):
if s.get('output_to_new_tab'):
self.scratch(result, title="Node Output", syntax="Packages/JavaScript/JavaScript.tmLanguage")
else:
self.panel(result)
20 changes: 15 additions & 5 deletions Nodejs.sublime-build
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"cmd": ["node", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.js"
}
{
"cmd": ["node", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.js",
"shell":true,
"encoding": "cp1252",
"windows":
{
"cmd": ["taskkill /F /IM node.exe & node", "$file"]
},
"linux":
{
"cmd": ["killall node; node", "$file"]
}
}
Loading

0 comments on commit a4d1eb1

Please sign in to comment.