-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
bug: Neovim not spawned in appropriate directory (fixes #2482) #2522
Conversation
Travis tests have failedHey @Chillee, Node.js: 8if [[ $(git diff-index HEAD --) ]]; then git diff; echo "Prettier Failed. Run `gulp` or `gulp forceprettier`"; exit 1; fi
|
src/neovim/neovim.ts
Outdated
@@ -14,8 +15,9 @@ export class Neovim implements vscode.Disposable { | |||
private nvim: Nvim; | |||
|
|||
async initialize() { | |||
const dir = dirname(vscode.window.activeTextEditor!.document.fileName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what you want is this vscode.window.activeTextEditor!.document.uri.fsPath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the documentation, it said that this is
/**
* The file system path of the associated resource. Shorthand
* notation for [TextDocument.uri.fsPath](#TextDocument.uri). Independent of the uri scheme.
*/
so I didn't think there was a difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, that's confusing. Generally, I would understand things named as fileName
to be just the file name (source.ts
), whereas filePath
would be a file path (/my/dir/source.ts
)
This makes the neovim process spawn in the directory of the file it's opened in.