Skip to content

Commit

Permalink
Merge pull request #922 from joegrasse/master
Browse files Browse the repository at this point in the history
Restore original files permissions
  • Loading branch information
fatih authored Jul 20, 2016
2 parents 595df51 + 2c52958 commit 902f626
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions autoload/go/asmfmt.vim
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ function! go#asmfmt#Format()

" Replace the current file with the temp file; then reload the buffer.
let old_fileformat = &fileformat
" save old file permissions
let original_fperm = getfperm(expand('%'))
call rename(l:tmpname, expand('%'))
" restore old file permissions
call setfperm(expand('%'), original_fperm)
silent edit!
let &fileformat = old_fileformat
let &syntax = &syntax
Expand Down
4 changes: 4 additions & 0 deletions autoload/go/fmt.vim
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ function! go#fmt#Format(withGoimport)

" Replace current file with temp file, then reload buffer
let old_fileformat = &fileformat
" save old file permissions
let original_fperm = getfperm(expand('%'))
call rename(l:tmpname, expand('%'))
" restore old file permissions
call setfperm(expand('%'), original_fperm)
silent edit!
let &fileformat = old_fileformat
let &syntax = &syntax
Expand Down

0 comments on commit 902f626

Please sign in to comment.