Skip to content

vim: Fix :RustRun when cwd has a space in it #18247

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

Merged
merged 1 commit into from
Nov 4, 2014
Merged
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 src/etc/vim/autoload/rust.vim
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ function! s:WithPath(func, ...)
call mkdir(tmpdir)

let save_cwd = getcwd()
silent exe 'lcd' tmpdir
silent exe 'lcd' fnameescape(tmpdir)

let path = 'unnamed.rs'

let save_mod = &mod
set nomod

silent exe 'keepalt write! ' . path
silent exe 'keepalt write! ' . fnameescape(path)
if pathisempty
silent keepalt 0file
endif
Expand All @@ -195,10 +195,10 @@ function! s:WithPath(func, ...)

call call(a:func, [path] + a:000)
finally
if exists("save_mod") | let &mod = save_mod | endif
if exists("save_write") | let &write = save_write | endif
if exists("save_cwd") | silent exe 'lcd' save_cwd | endif
if exists("tmpdir") | silent call s:RmDir(tmpdir) | endif
if exists("save_mod") | let &mod = save_mod | endif
if exists("save_write") | let &write = save_write | endif
if exists("save_cwd") | silent exe 'lcd' fnameescape(save_cwd) | endif
if exists("tmpdir") | silent call s:RmDir(tmpdir) | endif
endtry
endfunction

Expand Down