Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.
Merged
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
12 changes: 6 additions & 6 deletions lib/python-isort.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fs = require 'fs'
fs = require 'fs-plus'
$ = require 'jquery'
process = require 'child_process'

Expand All @@ -9,7 +9,7 @@ class PythonIsort
editor = atom.workspace.getActiveTextEditor()
if not editor?
return false
return editor.getGrammar().name == 'Python'
return editor.getGrammar().scopeName == 'source.python'

removeStatusbarItem: =>
@statusBarTile?.destroy()
Expand Down Expand Up @@ -44,8 +44,8 @@ class PythonIsort
if not @checkForPythonContext()
return

params = [@getFilePath(), "-c", "-vb"]
isortpath = atom.config.get "python-isort.isortPath"
params = ["-ns", @getFilePath(), @getFilePath(), "-c", "-vb"]
isortpath = fs.normalize(atom.config.get "python-isort.isortPath")

which = process.spawnSync('which', ['isort']).status
if which == 1 and not fs.existsSync(isortpath)
Expand All @@ -65,8 +65,8 @@ class PythonIsort
if not @checkForPythonContext()
return

params = [@getFilePath(), "-vb"]
isortpath = atom.config.get "python-isort.isortPath"
params = ["-ns", @getFilePath(), @getFilePath(), "-vb"]
isortpath = fs.normalize(atom.config.get "python-isort.isortPath")

which = process.spawnSync('which', ['isort']).status
if which == 1 and not fs.existsSync(isortpath)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"atom": ">=0.185.0 <2.0.0"
},
"dependencies": {
"fs-plus": "^2.8.1",
"jquery": "^2.1.4"
}
}