File tree 4 files changed +35
-20
lines changed
4 files changed +35
-20
lines changed Original file line number Diff line number Diff line change 1
1
[
2
- { "command" : " gist" , "caption" : " Create Public Gist" },
3
- { "command" : " gist_private" , "caption" : " Create Private Gist" },
4
- { "command" : " gist_list" , "caption" : " Get Gist List" }
2
+ { "command" : " gist" , "caption" : " Create Public Gist…" },
3
+ { "command" : " gist_private" , "caption" : " Create Private Gist…" }
5
4
]
Original file line number Diff line number Diff line change 1
1
[
2
2
{
3
- "caption" : " Gist (public) : Create from Selected Text " ,
3
+ "caption" : " Gist: Create Public Gist " ,
4
4
"command" : " gist"
5
5
},
6
6
{
7
- "caption" : " Gist (private) : Create from Selected Text " ,
7
+ "caption" : " Gist: Create Private Gist " ,
8
8
"command" : " gist_private"
9
9
},
10
+ {
11
+ "caption" : " Gist: Open Gist" ,
12
+ "command" : " gist_list"
13
+ },
10
14
{
11
15
"caption" : " Gist: Copy Gist URL" ,
12
16
"command" : " gist_copy_url"
20
24
"command" : " gist_update"
21
25
},
22
26
{
23
- "caption" : " Gist: Get List" ,
24
- "command" : " gist_list"
27
+ "caption" : " Gist: Rename File" ,
28
+ "command" : " gist_rename_file"
29
+ },
30
+ {
31
+ "caption" : " Gist: Change Gist Description" ,
32
+ "command" : " gist_rename"
33
+ },
34
+ {
35
+ "caption" : " Gist: Delete Gist File" ,
36
+ "command" : " gist_delete_file"
37
+ },
38
+ {
39
+ "caption" : " Gist: Delete Gist" ,
40
+ "command" : " gist_delete"
25
41
}
26
42
]
Original file line number Diff line number Diff line change 9
9
"caption" : " Gist" ,
10
10
"children" :
11
11
[
12
- { "command" : " gist" , "caption" : " Create Public Gist" },
13
- { "command" : " gist_private" , "caption" : " Create Private Gist" },
12
+ { "command" : " gist" , "caption" : " Create Public Gist…" },
13
+ { "command" : " gist_private" , "caption" : " Create Private Gist…" },
14
+ { "command" : " gist_list" , "caption" : " Open Gist…" },
15
+ { "caption" : " -" },
14
16
{ "command" : " gist_copy_url" , "caption" : " Copy Gist URL" },
15
17
{ "command" : " gist_open_browser" , "caption" : " Open Gist In Browser" },
16
18
{ "command" : " gist_update" , "caption" : " Update Gist" },
17
- { "command" : " gist_list" , "caption" : " Get Gist List" }
19
+ { "command" : " gist_rename_file" , "caption" : " Rename File…" },
20
+ { "command" : " gist_rename" , "caption" : " Change Gist Description…" },
21
+ { "command" : " gist_delete" , "caption" : " Delete Gist" }
18
22
]
19
23
}
20
24
Original file line number Diff line number Diff line change @@ -264,24 +264,20 @@ def on_gist_description(description):
264
264
for region in selections :
265
265
create_gist_with_text (self .view .substr (region ))
266
266
267
- class GistCopyUrl (sublime_plugin .TextCommand ):
267
+ class GistViewCommand (object ):
268
+ """A base class for commands operating on a gistified view"""
268
269
def is_enabled (self ):
269
- return self .view .settings ().get ("gist_html_url " ) is not None
270
+ return self .view .settings ().get ("gist_url " ) is not None
270
271
272
+ class GistCopyUrl (GistViewCommand , sublime_plugin .TextCommand ):
271
273
def run (self , edit ):
272
274
sublime .set_clipboard (self .view .settings ().get ("gist_html_url" ))
273
275
274
- class GistOpenBrowser (sublime_plugin .TextCommand ):
275
- def is_enabled (self ):
276
- return self .view .settings ().get ("gist_html_url" ) is not None
277
-
276
+ class GistOpenBrowser (GistViewCommand , sublime_plugin .TextCommand ):
278
277
def run (self , edit ):
279
278
webbrowser .open (self .view .settings ().get ("gist_html_url" ))
280
279
281
- class GistUpdateCommand (sublime_plugin .TextCommand ):
282
- def is_enabled (self ):
283
- return self .view .settings ().get ("gist_url" ) is not None
284
-
280
+ class GistUpdateCommand (GistViewCommand , sublime_plugin .TextCommand ):
285
281
@catch_errors
286
282
def run (self , edit ):
287
283
text = self .view .substr (sublime .Region (0 , self .view .size ()))
You can’t perform that action at this time.
0 commit comments