gistpad icon indicating copy to clipboard operation
gistpad copied to clipboard

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

Open bhrutledge opened this issue 5 years ago • 5 comments

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.

bhrutledge avatar Jun 29 '20 14:06 bhrutledge

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?

lostintangent avatar Jun 29 '20 14:06 lostintangent

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.

bhrutledge avatar Jun 29 '20 16:06 bhrutledge

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

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

carlocardella avatar Apr 15 '22 02:04 carlocardella

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!

lostintangent avatar Apr 15 '22 14:04 lostintangent

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

carlocardella avatar Apr 15 '22 14:04 carlocardella