bgreenlee / sublime-github

Sublime Text 2/3 plugin that provides a number of useful commands for GitHub.
MIT License
455 stars 98 forks source link

public_gist_from_selection not working #92

Closed ryanswapp closed 7 years ago

ryanswapp commented 8 years ago

Hello! I've been trying to get the text selection to gist feature working and it only ever seems to turn the whole file into a gist. Perhaps I am doing things wrong?

Currently, I select a block of text, press cmd + f4 (this is the keybinding I set to public_gist_from_selection), enter the description and gist name prompts, and then the gist that is created is the full file and not the selection.

Here is the relevant code to the keybinding if that is of interest:

{ "keys": ["super+f4"], "command": "public_gist_from_selection" },

I've also tried selecting text, pressing cmd + shift + p, selecting the public gist from selection option, and then filling out the prompts and it also does not work.

Also, I currently use vintageous. I'm wondering if this is preventing the plugin from working correctly?

bgreenlee commented 8 years ago

Are you using Sublime Text 2 or 3? Windows, Mac, or Linux? Could you open the console (ctrl-` or View -> Show Console) and tell me if there are any errors there?

It's working fine for me with ST3 on Mac. It's hard for me to test every combination of Sublime + OS, though.

ryanswapp commented 8 years ago

Hey sorry for leaving out that info.. I'm using ST3 on a mac. Just opened the console and it doesn't show any errors when I run the function.

Are you using vintageous or another vim emulator by chance? I'm wondering if the special select modes are interfering with the normal sublime select feature and are preventing the plugin from identifying whether text is selected. The plugin works, it just makes a new gist of the entire file and not the text I have selected.

bgreenlee commented 8 years ago

I don't use Vintageous. I will give that a try.

bgreenlee commented 8 years ago

I installed Vintageous and it still works for me (even using V to select a line, rather than the mouse, although that shouldn't matter). I wonder if some other package is causing an issue. I'm not sure how it would, though, as getting the selection is pretty straight-forward.

Let's first make sure you're running the current version. Open up the console and do this:

import sublime_github
print(sublime_github.VERSION)

You should get "118".

dreamfliper commented 7 years ago

I have same problem, I'm also using ST3 on mac. In my case, this is caused by an error from adding account from console. After I entered username and password in console, there is no action occur. Then I open console, and found this

Traceback (most recent call last):
  File "sublime_github in /Users/myname/Library/Application Support/Sublime Text 3/Installed Packages/sublime-github.sublime-package", line 104, in on_done_password
  File "/Users/myname/Library/Application Support/Sublime Text 3/Installed Packages/sublime-github.sublime-package/github.py", line 88, in get_token
github.UnknownException: 422 {"message":"Validation Failed","errors":[{"resource":"OauthAccess","code":"already_exists","field":"description"}],"documentation_url":"https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization"}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "sublime_github in /Users/myname/Library/Application Support/Sublime Text 3/Installed Packages/sublime-github.sublime-package", line 124, in on_done_password
AttributeError: 'UnknownException' object has no attribute 'message'

So I tried another method instead. This solve my problem.