Skip to content

Commit

Permalink
Make sure the buffer is not set as modified after a "storage#read"
Browse files Browse the repository at this point in the history
  • Loading branch information
boechat107 committed Aug 15, 2020
1 parent f3c030b commit 3ad98f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions autoload/storage.vim
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function! storage#read(cmd, path, dict) abort
silent execute 'put'
silent execute 'normal ggdd'
silent execute 'filetype detect'
setlocal nomodified
else
setlocal nomodified
let ls_result = storage#ls_cmd(a:cmd, a:path)
Expand Down
5 changes: 1 addition & 4 deletions spec/storage_spec.vim
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@ endfunction

call Mock_function('storage#get_cmd', funcref('Get_stub'))

" This testing function does not work at first time the script is sourced. The
" reason is explained in this link:
" https://stackoverflow.com/a/22633702/747872
function! Spec_storage_read() abort
echo 'storage#read()'
let current_buffer = @%
let storage_dict = {}
let storage_cmd = 's3cmd'
let storage_cmd = 'whatever'
let file_path = 's3://some-bucket/some-file'

echo repeat(' ', 2) . 'when called twice for the same file'
Expand Down

0 comments on commit 3ad98f5

Please sign in to comment.