lostintangent / gistpad

VS Code extension for managing and sharing code snippets, notes and interactive samples using GitHub Gists
https://aka.ms/gistpad
MIT License
937 stars 58 forks source link

Add "GistPad: Copy File to Gist" to command palette #159

Open bhrutledge opened 4 years ago

bhrutledge commented 4 years ago

My typical workflow is to write a file locally, then publish it as a new Gist. Currently, that's possible by revealing the file in the sidebar, right-clicking on the file, and clicking "Copy File to Gist".

It would be really nice if I could use the command palette instead.

lostintangent commented 4 years ago

Just as an FYI, you can also right-click the tab handle for the file, and select “Copy File to Gist”. That way, you could copy the currently opened file to a gist, without needing to find it in the Explorer tree view. Would that suit your workflow?

bhrutledge commented 4 years ago

Ah, thanks for the tip. That's better, but still requires interacting with the mouse. 😉

Putting it in the command palette means it's just a few keyboard strokes, and I'll end up there anyway when entering the Gist name.

carlocardella commented 2 years ago

@lostintangent any reason not to change this when condition to gistpad:state == SignedIn?

https://github.com/lostintangent/gistpad/blob/a346f6ca1409bc575cf74a4edad5686a5dfb96de/package.json#L604-L607

lostintangent commented 2 years ago

The last time I looked at this, I think that the command needed to also be updated in order to properly detect that an editor was active and use it as the copy source. But the change shouldn't be too significant? If you wanted to submit a PR, that would be great!

carlocardella commented 2 years ago

Yes, I quickly tested it last night, when calling the command from the Palette one of the objects is not initialized (I guess that comes from the click event on the Tree); it needs a bit of work but should be doable