Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Thrown on Delete #346

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
npm-debug.log
node_modules
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# activate-power-mode atom package
A package for Atom to replicate the effects from [codeinthedark/editor](https://github.com/codeinthedark/editor). Available through the Atom package installer (https://atom.io/packages/activate-power-mode).
# activate-power-mode-delete atom package
A package forked from [activate-power-mode](https://atom.io/packages/activate-power-mode). Original package was overwhelming, these effects are on delete only. Available through the Atom package installer (https://atom.io/packages/activate-power-mode-delete).

Activate with <kbd>Ctrl</kbd>-<kbd>Alt</kbd>-<kbd>O</kbd> or through the command panel with `Activate Power Mode: Toggle`. Use the command again to deactivate.
Activate with <kbd>Ctrl</kbd>-<kbd>Alt</kbd>-<kbd>o</kbd> or through the command panel with `Activate Power Mode: Toggle`. Use the command again to deactivate.

![activate-power-mode-0 4 0](https://cloud.githubusercontent.com/assets/688415/11615565/10f16456-9c65-11e5-8af4-265f01fc83a0.gif)

**For a list of power mode packages to other editors, check out [codeinthedark/awesome-power-mode](https://github.com/codeinthedark/awesome-power-mode).**
2 changes: 1 addition & 1 deletion keymaps/activate-power-mode.cson
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
# For more detailed documentation see
# https://atom.io/docs/latest/behind-atom-keymaps-in-depth
'atom-workspace':
'ctrl-alt-o': 'activate-power-mode:toggle'
'ctrl-alt-o': 'activate-power-mode-delete:toggle'
29 changes: 15 additions & 14 deletions lib/activate-power-mode.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = ActivatePowerMode =
activate: (state) ->
@subscriptions = new CompositeDisposable
@subscriptions.add atom.commands.add "atom-workspace",
"activate-power-mode:toggle": => @toggle()
"activate-power-mode-delete:toggle": => @toggle()

@activeItemSubscription = atom.workspace.onDidStopChangingActivePaneItem =>
@subscribeToActiveTextEditor()
Expand All @@ -31,7 +31,7 @@ module.exports = ActivatePowerMode =
@canvas = null

getConfig: (config) ->
atom.config.get "activate-power-mode.#{config}"
atom.config.get "activate-power-mode-delete.#{config}"

subscribeToActiveTextEditor: ->
@throttledShake = throttle @shake.bind(this), 100, trailing: false
Expand Down Expand Up @@ -63,18 +63,19 @@ module.exports = ActivatePowerMode =
left: scrollViewRect.left - editorRect.left

onChange: (e) ->
return if not @active
spawnParticles = true
if e.newText
spawnParticles = e.newText isnt "\n"
range = e.newRange.end
else
range = e.newRange.start

if spawnParticles and @getConfig "particles.enabled"
@throttledSpawnParticles range
if @getConfig "screenShake.enabled"
@throttledShake()
if e.newText is ""
return if not @active
spawnParticles = true
if e.newText
spawnParticles = e.newText isnt "\n"
range = e.newRange.end
else
range = e.newRange.start

if spawnParticles and @getConfig "particles.enabled"
@throttledSpawnParticles range
if @getConfig "screenShake.enabled"
@throttledShake()

shake: ->
min = @getConfig "screenShake.minIntensity"
Expand Down
8 changes: 4 additions & 4 deletions menus/activate-power-mode.cson
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
'context-menu':
'atom-text-editor': [
{
'label': 'Toggle activate-power-mode'
'command': 'activate-power-mode:toggle'
'label': 'Toggle activate-power-mode-delete'
'command': 'activate-power-mode-delete:toggle'
}
]
'menu': [
{
'label': 'Packages'
'submenu': [
'label': 'activate-power-mode'
'label': 'activate-power-mode-delete'
'submenu': [
{
'label': 'Toggle'
'command': 'activate-power-mode:toggle'
'command': 'activate-power-mode-delete:toggle'
}
]
]
Expand Down
99 changes: 94 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,106 @@
{
"name": "activate-power-mode",
"name": "activate-power-mode-delete",
"main": "./lib/activate-power-mode",
"version": "0.5.2",
"description": "Activate POWER MODE to write your code in style.",
"version": "0.6.1",
"description": "Activate POWER MODE to DELETE powerfully. Original package was overwhelming, these effects are on delete only.",
"keywords": [],
"repository": "https://github.com/JoelBesada/activate-power-mode",
"author": "Joel Besada <[email protected]> (http://joelb.me)",
"repository": {
"type": "git",
"url": "git+https://github.com/valmassoi/activate-power-mode-delete.git"
},
"author": {
"name": "Joel Besada",
"email": "[email protected]",
"url": "http://joelb.me"
},
"license": "MIT",
"engines": {
"atom": ">=1.0.0 <2.0.0"
},
"dependencies": {
"lodash.random": "^3.0.1",
"lodash.throttle": "^3.0.4"
},
"readme": "# activate-power-mode-delete atom package\nA package forked from [activate-power-mode](https://atom.io/packages/activate-power-mode). Original package was overwhelming, these effects are on delete only. Available through the Atom package installer (https://atom.io/packages/activate-power-mode-delete). \n\nActivate with <kbd>Ctrl</kbd>-<kbd>Alt</kbd>-<kbd>o</kbd> or through the command panel with `Activate Power Mode: Toggle`. Use the command again to deactivate. \n\n![activate-power-mode-delete-0 4 0](https://cloud.githubusercontent.com/assets/688415/11615565/10f16456-9c65-11e5-8af4-265f01fc83a0.gif)\n",
"readmeFilename": "README.md",
"bugs": {
"url": ""
},
"homepage": "",
"_id": "[email protected]",
"_shasum": "90494cba611dae866dfcec93e06fa8c64a1cd4f8",
"_resolved": "file:../d-11644-1664-lba25h/package.tgz",
"_from": "../d-11644-1664-lba25h/package.tgz",
"_atomModuleCache": {
"version": 1,
"dependencies": [
{
"name": "lodash.random",
"version": "3.1.4",
"path": "node_modules/lodash.random/index.js"
},
{
"name": "lodash.throttle",
"version": "3.0.4",
"path": "node_modules/lodash.throttle/index.js"
},
{
"name": "lodash.debounce",
"version": "3.1.1",
"path": "node_modules/lodash.throttle/node_modules/lodash.debounce/index.js"
},
{
"name": "lodash._getnative",
"version": "3.9.1",
"path": "node_modules/lodash.throttle/node_modules/lodash.debounce/node_modules/lodash._getnative/index.js"
}
],
"extensions": {
".coffee": [
"lib/activate-power-mode.coffee",
"lib/config-schema.coffee"
],
".js": [
"node_modules/lodash.random/index.js",
"node_modules/lodash.throttle/index.js",
"node_modules/lodash.throttle/node_modules/lodash.debounce/index.js",
"node_modules/lodash.throttle/node_modules/lodash.debounce/node_modules/lodash._getnative/index.js"
],
".json": [
"node_modules/lodash.random/package.json",
"node_modules/lodash.throttle/node_modules/lodash.debounce/node_modules/lodash._getnative/package.json",
"node_modules/lodash.throttle/node_modules/lodash.debounce/package.json",
"node_modules/lodash.throttle/package.json",
"package.json"
]
},
"folders": [
{
"paths": [
"lib",
""
],
"dependencies": {
"lodash.random": "^3.0.1",
"lodash.throttle": "^3.0.4"
}
},
{
"paths": [
"node_modules/lodash.throttle"
],
"dependencies": {
"lodash.debounce": "^3.0.0"
}
},
{
"paths": [
"node_modules/lodash.throttle/node_modules/lodash.debounce"
],
"dependencies": {
"lodash._getnative": "^3.0.0"
}
}
]
}
}