Skip to content

Commit

Permalink
Final version
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Feb 17, 2017
1 parent 47a5c75 commit 607596e
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 11 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
6 changes: 0 additions & 6 deletions Default.sublime-keymap

This file was deleted.

Empty file modified LICENSE
100644 → 100755
Empty file.
83 changes: 83 additions & 0 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
[
{
"caption": "Preferences",
"mnemonic": "n",
"id": "preferences",
"children":
[
{
"caption": "Package Settings",
"mnemonic": "P",
"id": "package-settings",
"children":
[
{
"caption": "Meteor Reval",
"children":
[
{
"command": "open_file",
"args": {"file": "${packages}/MeteorReval/MeteorReval.sublime-settings"},
"caption": "Settings – Default"
},
{
"command": "open_file",
"args": {"file": "${packages}/User/MeteorReval.sublime-settings"},
"caption": "Settings – User"
},
{
"command": "open_file",
"args": {
"file": "${packages}/MeteorReval/Default (Windows).sublime-keymap",
"platform": "Windows"
},
"caption": "Key Bindings – Default"
},
{
"command": "open_file",
"args": {
"file": "${packages}/MeteorReval/Default (OSX).sublime-keymap",
"platform": "OSX"
},
"caption": "Key Bindings – Default"
},
{
"command": "open_file",
"args": {
"file": "${packages}/MeteorReval/Default (Linux).sublime-keymap",
"platform": "Linux"
},
"caption": "Key Bindings – Default"
},
{
"command": "open_file",
"args": {
"file": "${packages}/User/Default (Windows).sublime-keymap",
"platform": "Windows"
},
"caption": "Key Bindings – User"
},
{
"command": "open_file",
"args": {
"file": "${packages}/User/Default (OSX).sublime-keymap",
"platform": "OSX"
},
"caption": "Key Bindings – User"
},
{
"command": "open_file",
"args": {
"file": "${packages}/User/Default (Linux).sublime-keymap",
"platform": "Linux"
},
"caption": "Key Bindings – User"
},
{ "caption": "-" }
]
}
]
}
]
}
]
12 changes: 7 additions & 5 deletions MeteorReload.py → MeteorReval.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,28 @@
import re


settings = sublime.load_settings("MeteorReload.sublime-settings")
settings = sublime.load_settings("MeteorReval.sublime-settings")

class meteorReload(sublime_plugin.EventListener):
class meteorReval(sublime_plugin.EventListener):
pending = 0

def handleTimeout(self, view):
self.pending = self.pending - 1
if self.pending == 0:
view.run_command("meteor_reload")
view.run_command("meteor_reval")

def on_modified_async(self, view):
if settings.get('reload_on_modified') is True:
required_path = settings.get('required_path')
required_regex = settings.get('required_regex')
file_path = view.file_name()
print (file_path)
if (file_path and file_path.find(required_path) >= 0 and re.search(required_regex, file_path)):
self.pending = self.pending + 1
print ('here')
sublime.set_timeout(functools.partial(self.handleTimeout, view), settings.get('reload_debounce'))

class meteorReloadCommand(sublime_plugin.TextCommand):
class meteorRevalCommand(sublime_plugin.TextCommand):
def run(self, view):
if (self.view.file_name()):
path = settings.get('path')
Expand Down Expand Up @@ -299,4 +301,4 @@ def clear_fragment(self):
self.fragment = None

def set_scehem(self, scheme):
self.scheme = scheme
self.scheme = scheme
File renamed without changes.
Empty file modified README.md
100644 → 100755
Empty file.

0 comments on commit 607596e

Please sign in to comment.