aki77 / atom-gist Goto Github PK
View Code? Open in Web Editor NEWcreate and insert Gists
Home Page: https://atom.io/packages/gist
License: MIT License
create and insert Gists
Home Page: https://atom.io/packages/gist
License: MIT License
Hi! Thanks for maintaining the gist package!
In Atom v1.19, we will release a major change to Atom's core text buffer data structure. As part of this change, we have made TextBuffer.save
asynchronous; rather than blocking until the save is complete, it now immediately returns a Promise
that resolves when the save is complete. Because of this, a few other Atom APIs that use save
have similarly become async:
Pane.close
TextBuffer.save
TextEditor.save
Pane.saveItem
Pane.saveItemAs
Pane.saveActiveItem
Pane.saveActiveItemAs
Pane.saveItems
Workspace.saveActivePaneItem
Workspace.saveActivePaneItemAs
We think this package could be impacted by this upgrade because it calls the changed methods in the following places:
TextEditor.save
We found these calls using a regex search, so this list might be incomplete, and it might contain some false positives.
It should be pretty easy to adjust your package code and/or tests to work with the new async behavior, and to simultaneously keep it working with older versions of Atom. Here are some examples of pull requests we opened on our bundled packages to cope with the change:
Please let me know if you have any questions. I would be happy to help!
[Enter steps to reproduce below:]
Atom Version: 1.1.0
System: Mac OS X 10.11.1
Thrown From: gist package, v0.2.6
Uncaught TypeError: target.getModel is not a function
At /Users/vil/.atom/packages/gist/lib/main.coffee:40
TypeError: target.getModel is not a function
at atom-text-editor.subscriptions.add.atom.commands.add.gist:list (/Users/vil/.atom/packages/gist/lib/main.coffee:40:47)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:243:29)
at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
at CommandPaletteView.module.exports.CommandPaletteView.confirmed (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/command-palette/lib/command-palette-view.js:159:32)
at CommandPaletteView.module.exports.SelectListView.confirmSelection (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:338:21)
at space-pen-div.atom.commands.add.core:confirm (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:109:19)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:243:29)
at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:528:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:351:22)
at HTMLDocument.module.exports.WindowEventHandler.handleDocumentKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:97:20)
-0:46.6.0 core:backspace (input.hidden-input)
-0:45 core:undo (input.hidden-input)
-0:41 command-palette:toggle (input.hidden-input)
-0:38 core:confirm (input.hidden-input)
-0:38 gist:list (input.hidden-input)
-0:28.1.0 command-palette:toggle (input.hidden-input)
-0:25.9.0 core:move-down (input.hidden-input)
-0:23.9.0 core:confirm (input.hidden-input)
-0:23.9.0 gist:create-public (input.hidden-input)
-0:07.6.0 command-palette:toggle (input.hidden-input)
3x -0:05.0 core:move-down (input.hidden-input)
3x -0:03.0 core:move-up (input.hidden-input)
-0:02.3.0 core:confirm (input.hidden-input)
-0:02.3.0 gist:list (input.hidden-input)
{
"core": {
"themes": [
"one-dark-ui",
"chester-atom-syntax"
],
"disabledPackages": [
"git-plus",
"auto-indent",
"SFTP-deployment",
"jsdoc",
"language-cshtml",
"merge-conflicts",
"project-manager",
"Remote-FTP",
"atom-color-highlight"
],
"packagesWithKeymapsDisabled": [
"tidy-tabs"
]
},
"gist": {
"token": "cf97a5660ab7270ddbc997ea93eebd5f54eb4a10"
}
}
# User
aligner, v0.17.1
atom-pair, v2.0.10
atom-ternjs, v0.8.4
change-case, v0.6.0
chester-atom-syntax, v0.1.1
emmet, v2.3.13
file-icons, v1.6.11
gist, v0.2.6
minimap, v4.15.1
php-cs-fixer, v2.5.1
php-twig, v4.0.0
remote-sync, v3.1.2
symbols-tree-view, v0.10.1
sync-settings, v0.6.0
tidy-tabs, v0.3.0
# Dev
No dev packages
Some of the gists in my gists list are not showing up but are showing in my gist list. I've gone and deleted the gist and created it again and it appears. This has been happening to numerous gists after a period of time about month or so.
Opening a new gist should have nothing to do with the currently open file(or no open files)
Today, I often find myself opening an empty buffer to be able to find the action Gist:list
in the command palette. Could this be accessible also on a window without active buffers?
+1
Hello,
Since updating to 0.2.7 today, I just get the 'Bad Credentials' error when I try and list my Gists. I can't see anything in the changes that would have affected this.
I have tried generating a new token and working with that, but get the same error.
Is there some more debug info I can get that would be useful?
running 1.23.1 x 64 (linux).
no errors in console.
What are setup instructions to use this this plugin?
Getting error message after installation:
"Error: required token"
Assume it is talking about Personal Access Token (PAT), is that right?
Can a single PAT be used across multiple plugin?
Is it better to create a unique PAT for each plugin?
Thank you.
Maybe a regression of #2? I’m having the same issue; the options don’t show up in Settings view at all…
I can manually put gist: environmentName: "GITHUB_TOKEN"
into config.cson
, and the package then works, but Settings view still doesn't match the README screenshot, so something is amiss…
When I edit my gist and save it closes the tab, then If I want to edit again I have to open the gist in the list.
The preferred behavior it is to maintain the gist tab open when saving.
Hi Aki! I think it would be nice to handle multiple files in the same gist. This would be a great manner of manage your snippets using gists and easly search and insert them inside your code.
May I be avail to help you if you want/need. But first lemme know what you thing about it.
Thanks, see u.
I know I can open it via Gist:list, find the gist, tab, arrows to open in browser, enter.
In sublime I had an action to open gist in browser on the main actions finder. It would be neat to have this here too.
I often save files I'm working on through habit, but when I'm editing a gist saving the file causes it to close.
To reproduce:
tab
Edit
⌘-S
I can see why the close-on-save behaviour would exist, and it's also quite useful for me. A config option could work well to preserve the existing behaviour but also allow close-on-save. What do you think?
Hi! Thanks for maintaining the gist package!
In Atom v1.19, we will release a major change to Atom's core text buffer data structure. As part of this change, we have made TextBuffer.save
asynchronous; rather than blocking until the save is complete, it now immediately returns a Promise
that resolves when the save is complete. Because of this, a few other Atom APIs that use save
have similarly become async:
Pane.close
TextBuffer.save
TextEditor.save
Pane.saveItem
Pane.saveItemAs
Pane.saveActiveItem
Pane.saveActiveItemAs
Pane.saveItems
Workspace.saveActivePaneItem
Workspace.saveActivePaneItemAs
We think this package could be impacted by this upgrade because it calls the changed methods in the following places:
TextEditor.save
We found these calls using a regex search, so this list might be incomplete, and it might contain some false positives.
It should be pretty easy to adjust your package code and/or tests to work with the new async behavior, and to simultaneously keep it working with older versions of Atom. Here are some examples of pull requests we opened on our bundled packages to cope with the change:
Please let me know if you have any questions. I'd be happy to help!
Hello!
This is a bug that has been around for a while, I've just not got round to reporting it. It's not a massive problem, just a minor inconvenience.
Firstly, the plugin only appears in the command panel if you're on a 'file' tab, i.e. a real file (not the settings tab). This was probably intentional due to the nature of the plugin being for inserting / saving existing content as a Gist, however I only use it to create / edit Gists and not interact with files.
Secondly, if you hit Tab instead of Enter in the command panel, the plugin is removed from the command list until you reload / focus a (real) file tab.
My ideal solution for this would be able to set in the preferences the default behaviour when you hit enter on a gist. Currently it 'inserts', but personally I want it to open, and edit in a new tab, so every time I use it I have to press Enter -> Find the Gist -> Tab -> Edit
If you'd like any more info, just let me know :)
Hello I am using atom-gist 0.3.1,
since I reinstalled atom a while ago, I am always getting the bad credentials error when trying to use the gist plugin.
I have my token in the token file. Here are my settings:
When I use the command line
$ curl -H "Authorization: token 0493ebc99ca05XXXXXX18564c8ceX8XX9bab9" https://api.github.com/gists/starred
my token words. Also from the issue at #6 I figured I try these two commands in the atom developer console:
atom.packages.getLoadedPackage('gist').mainModule.getToken()
as well as
require('fs').readFileSync('/Users/idf/.atom/.gist-token', 'utf8')
and they both return the correct token. On the other hand, process.env.GIST_ACCESS_TOKEN
returns 'undefined'
.
I am not sure what the problem is, but I've had this for a couple weeks now.
hello, bigcow! nice work! when i type gist:list, the result show item make the title text as the gist file name with bold, and with the gray text of gist description below it, i feel that not so comfortable to read, maybe i had some kind of OCD, but i really hope the title can be the gist description and followed with the gist file name, could you make a setting option here please, just like the application of gisto does? 3Q
gist description
gist file name
atom-gist is listing my gists perfectly. I can Edit, Delete and View in browser without an issue.
But I can't Insert. When I select a gist and press 'enter', nothing happens - the gist isn't inserted.
Using this package alongside the sync-settings
package, which stores your Atom settings in Gists for easy sharing between multiple Atom environments, can cause your Github Personal Access Token to be visible publicly since it is stored in Atom's setting.json
.
After setting up this package today, I got a email from Github saying a PAT of mine was visible in a public gist (aka my sync-settings
files), and they revoked it.
Not sure what you can do to circumvent this, but wanted to bring to your attention anyways.
I would love to be able to save/retrieve gists wile performing a find/replace. I have some regular expressions saved which would be nice to retrieve for searches
What is the problem?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.