-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c94fcf
commit db03811
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[{ | ||
"id": "preferences", | ||
"children": [{ | ||
"id": "package-settings", | ||
"children": [{ | ||
"caption": "SublimeMate", | ||
"children": [{ | ||
"caption": "Main", | ||
"command": "sublime_mate" | ||
}, { | ||
"caption": "Help", | ||
"command": "sublime_mate_open_help" | ||
}, { | ||
"caption": "File a bug", | ||
"command": "sublime_mate_open_bug_file" | ||
}, { | ||
"caption": "What's new in v2.0?", | ||
"command": "sublime_mate_open_release_notes" | ||
}] | ||
}] | ||
}] | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import sys | ||
import sublime | ||
import sublime_plugin | ||
from os.path import dirname | ||
from sublime_plugin import TextCommand | ||
from webbrowser import open_new_tab | ||
|
||
sys.path.insert(0, dirname(__file__)) | ||
|
||
|
||
class SublimeMateCommand(TextCommand): | ||
def run(self, edit): | ||
self.view.insert(edit, 0, "Hello, World!") | ||
|
||
|
||
class SublimeMateOpenHelpCommand(TextCommand): | ||
def run(self, _): | ||
view_readme() | ||
|
||
|
||
class SublimeMateOpenBugFile(TextCommand): | ||
def run(self, _): | ||
file_bug() | ||
|
||
|
||
class SublimeMateOpenReleaseNotes(TextCommand): | ||
def run(self, _): | ||
view_release_notes() | ||
|
||
def file_bug(): | ||
"""Opens a new tab in the default browser at this plugin's repo""" | ||
url = "https://github.com/liushoukai/SublimeMate/issues/new" | ||
open_new_tab(url) | ||
|
||
|
||
def view_readme(): | ||
"""Opens a new tab in the default browser at this plugin's repo""" | ||
url = "https://github.com/liushoukai/SublimeMate/blob/master/README.md" | ||
open_new_tab(url) | ||
|
||
|
||
def view_release_notes(): | ||
"""Opens a new tab in the default browser at this plugin's repo""" | ||
url = "https://github.com/liushoukai/SublimeMate/releases" | ||
open_new_tab(url) |