Skip to content

Commit

Permalink
Fix the deprecated warning in Promise.done()
Browse files Browse the repository at this point in the history
Atom now uses ES6 Promises instead of Q. Call promise.then instead of
promise.done
  • Loading branch information
darfux committed May 6, 2017
1 parent 740a20d commit d1fef2d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/gtags-files.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ class GtagsFiles
# console.log "keep #{path}"
GtagsFiles.keepOpened.push path

atom.workspace.open(path,{activatePane:false}).done =>
atom.workspace.open(path,{activatePane:false}).then =>
GtagsFiles.moveToLine(line)

@open: (path, line) ->
GtagsFiles.keepOpened.push path
atom.workspace.open(path,{activatePane:true}).done =>
atom.workspace.open(path,{activatePane:true}).then =>
GtagsFiles.moveToLine(line)
GtagsFiles.clear()

Expand Down
2 changes: 1 addition & 1 deletion lib/gtags-navigation.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class GtagsNavigation
return GtagsNavigation.curIndex[id]

@openPath: (path, position, id=1) ->
atom.workspace.open(path).done => GtagsNavigation.moveToLine(position, id)
atom.workspace.open(path).then => GtagsNavigation.moveToLine(position, id)
#console.log GtagsNavigation.trace

@moveToLine: (position, id) ->
Expand Down
2 changes: 1 addition & 1 deletion lib/gtags-symbols-view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class GtagsSymbolsView extends SelectListView
@prePath = textEditor.getPath()
@prePosition = textEditor.getCursorBufferPosition()
GtagsNavigation.add(@prePath, @prePosition['row']+1, "")
atom.workspace.open(path).done => @moveToLine(line)
atom.workspace.open(path).then => @moveToLine(line)
# add new path
GtagsNavigation.add(path, line, "")

Expand Down

0 comments on commit d1fef2d

Please sign in to comment.