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

save (:w or :wq) with SSHFS and LiveShare guest don't work properly #2956

Closed
kangzhang opened this issue Aug 14, 2018 · 5 comments · Fixed by #3281
Closed

save (:w or :wq) with SSHFS and LiveShare guest don't work properly #2956

kangzhang opened this issue Aug 14, 2018 · 5 comments · Fixed by #3281

Comments

@kangzhang
Copy link

I'm using VS Code with a remote workspace (via an extension that integrates with our dev-server) and saving files with ":w" always gives me error. It seems our private extension overloaded the "save" action in VS Code but the VIM extension is bypassing the editor's save API.

Describe the solution you'd like
We can have an additional flag in settings to bypass the local file write. A check of the setting can be added at here:

if (vimState.editor.document.isUntitled) {

@jpoon
Copy link
Member

jpoon commented Aug 25, 2018

Contributions are welcome.

@zhuzisheng
Copy link
Contributor

Is it safe to add the condition as below?

if (vimState.editor.document.isUntitled || vimState.editor.document.uri.scheme !== 'file') {
.....
}

I make this change in my local version.

@zhuzisheng
Copy link
Contributor

there is another issue when editing remote files.
If the file is created remotely, edited and saved, the file is in dos format.
this may cause issues when the remote system is linux.

@jpoon jpoon changed the title Need an option to bypass the local file writes for :w bug: save with SSHFS and LiveShare guest don't work properly Dec 30, 2018
@jpoon
Copy link
Member

jpoon commented Dec 30, 2018

#3304 (comment) has a good repro

@jpoon jpoon changed the title bug: save with SSHFS and LiveShare guest don't work properly save (:w or :wq) with SSHFS and LiveShare guest don't work properly Dec 30, 2018
@zhuzisheng
Copy link
Contributor

Hi jpoon,

Is it ok to remove fs module's file access checking before saving the file?
The fs module can only support "file" scheme/uri, which is in its documents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants