Skip to content

Commit

Permalink
Updates to Atoms new API
Browse files Browse the repository at this point in the history
Small changes for the the new API
  • Loading branch information
aparedes committed Jan 27, 2015
1 parent 9566a49 commit d24a454
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/beautify.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ beautify = ({onSave}) ->
# console.log 'Beautify time!'

# Get current editor
editor = atom.workspace.getActiveEditor()
editor = atom.workspace.getActiveTextEditor()
# Check if there is an active editor
if not editor?
return showError(new Error("Active Editor not found. "
Expand Down Expand Up @@ -211,7 +211,7 @@ beautifyDirectory = ({target}) ->
return

handleSaveEvent = =>
atom.workspace.eachEditor (editor) =>
atom.workspace.observeTextEditors (editor) =>
buffer = editor.getBuffer()
plugin.unsubscribe buffer
if atom.config.get("atom-beautify.beautifyOnSave")
Expand Down
5 changes: 3 additions & 2 deletions lib/loading-view.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{View} = require "atom"
{View} = require 'space-pen'
{TextEditorView} = require 'atom-space-pen-views'

module.exports =
class LoadingView extends View
Expand Down Expand Up @@ -35,4 +36,4 @@ class LoadingView extends View

show: =>
if not @.hasParent()
atom.workspaceView.appendToTop @
atom.workspace.addTopPanel(item: @)
2 changes: 1 addition & 1 deletion menus/atom-beautify.cson
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# See https://atom.io/docs/latest/creating-a-package#menus for more details
'context-menu':
'.workspace .editor:not(.mini)':
'atom-workspace atom-text-editor:not(.mini)':
'Enable atom-beautify': 'beautify:beautify-editor'
'.tree-view .file > .name':
'Beautify File': 'beautify:beautify-file'
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
"strip-json-comments": "^0.1.3",
"temp": "^0.8.0",
"typescript-formatter": "~0.1.4",
"yaml-front-matter": "^3.2.3"
"yaml-front-matter": "^3.2.3",
"atom-space-pen-views": "^2.0.3"
},
"activationCommands": {
"atom-workspace": [
Expand Down
File renamed without changes.

1 comment on commit d24a454

@Glavin001
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.