This repository was archived by the owner on May 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +83
-1
lines changed
Expand file tree Collapse file tree 3 files changed +83
-1
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "default_browser" : " "
3+
4+ // Type Name Class Name Notes
5+ // 'mozilla' Mozilla('mozilla')
6+ // 'firefox' Mozilla('mozilla')
7+ // 'netscape' Mozilla('netscape')
8+ // 'galeon' Galeon('galeon')
9+ // 'epiphany' Galeon('epiphany')
10+ // 'skipstone' BackgroundBrowser('skipstone')
11+ // 'kfmclient' Konqueror() (1)
12+ // 'konqueror' Konqueror() (1)
13+ // 'kfm' Konqueror() (1)
14+ // 'mosaic' BackgroundBrowser('mosaic')
15+ // 'opera' Opera()
16+ // 'grail' Grail()
17+ // 'links' GenericBrowser('links')
18+ // 'elinks' Elinks('elinks')
19+ // 'lynx' GenericBrowser('lynx')
20+ // 'w3m' GenericBrowser('w3m')
21+ // 'windows-default' WindowsDefault (2)
22+ // 'internet-config' InternetConfig (3)
23+ // 'macosx' MacOSX('default') (4)
24+ }
25+
Original file line number Diff line number Diff line change 1+ [
2+ {
3+ "id" : " tools" ,
4+ "children" :
5+ [
6+ {
7+ "caption" : " Can I Use" ,
8+ "children" :
9+ [
10+ { "caption" : " Command name" , "command" : " useIt" }
11+ ]
12+ }
13+ ]
14+ },
15+ {
16+ "caption" : " Preferences" ,
17+ "mnemonic" : " n" ,
18+ "id" : " preferences" ,
19+ "children" :
20+ [
21+ {
22+ "caption" : " Package Settings" ,
23+ "mnemonic" : " P" ,
24+ "id" : " package-settings" ,
25+ "children" :
26+ [
27+ {
28+ "caption" : " Can I Use" ,
29+ "children" :
30+ [
31+ {
32+ "command" : " open_file" ,
33+ "args" : {"file" : " ${packages}/Can I Use/Can I Use.sublime-settings" },
34+ "caption" : " Settings – Default"
35+ },
36+ {
37+ "command" : " open_file" ,
38+ "args" : {"file" : " ${packages}/User/Can I Use.sublime-settings" },
39+ "caption" : " Settings – User"
40+ },
41+ { "caption" : " -" }
42+ ]
43+ }
44+ ]
45+ }
46+ ]
47+ }
48+ ]
Original file line number Diff line number Diff line change 1+ import sublime
12import sublime_plugin
3+
4+ import sys
25import re
36import webbrowser
47
@@ -15,6 +18,9 @@ class UseItCommand(sublime_plugin.TextCommand):
1518 """
1619
1720 def run (self , edit ):
21+ s = sublime .load_settings ("Can I Use.sublime-settings" )
22+ default_browser = s .get ('default_browser' , '' )
23+
1824 for region in self .view .sel ():
1925 # Get the start point of the region of the selection
2026 point = region .begin ()
@@ -26,4 +32,7 @@ def run(self, edit):
2632 re_search = CLEAN_CSS_PATTERN .search (search )
2733 if re_search :
2834 search = re_search .group ()
29- webbrowser .open_new_tab (BASE_URL + search )
35+
36+
37+ browser = webbrowser .get (default_browser )
38+ browser .open_new_tab (BASE_URL + search )
You can’t perform that action at this time.
0 commit comments