diff --git a/autoload/storage.vim b/autoload/storage.vim index b1a3850..22724a3 100644 --- a/autoload/storage.vim +++ b/autoload/storage.vim @@ -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) diff --git a/spec/storage_spec.vim b/spec/storage_spec.vim index 9e8e4f9..2b52631 100644 --- a/spec/storage_spec.vim +++ b/spec/storage_spec.vim @@ -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'