7070"  user.
7171"  ---------------------------------------------------------------------------
7272func !  s: create_changelog () abort 
73+   let  changelog =  [' Updated Plugins:'  ]
7374  for  bundle_data in  g: updated_bundles
7475    let  initial_sha =  bundle_data[0 ]
7576    let  updated_sha =  bundle_data[1 ]
@@ -83,33 +84,35 @@ func! s:create_changelog() abort
8384
8485    let  updates =  system (cmd)
8586
86-     call  add (g: vundle_changelog  , ' '  )
87-     call  add (g: vundle_changelog  , ' Updated Plugin: '  .bundle.name)
87+     call  add (changelog , ' '  )
88+     call  add (changelog , ' Updated Plugin: '  .bundle.name)
8889
8990    if  bundle.uri = ~ " https://github.com" 
90-       call  add (g: vundle_changelog  , ' Compare at: '  .bundle.uri[0 :-5 ].' /compare/'  .initial_sha.' ...'  .updated_sha)
91+       call  add (changelog , ' Compare at: '  .bundle.uri[0 :-5 ].' /compare/'  .initial_sha.' ...'  .updated_sha)
9192    endif 
9293
9394    for  update  in  split (updates, ' \n'  )
9495      let  update  =  substitute (update , ' \s\+$'  , ' '  , ' '  )
95-       call  add (g: vundle_changelog  , '   '  .update )
96+       call  add (changelog , '   '  .update )
9697    endfor 
9798  endfor 
99+   return  changelog
98100endf 
99101
100102
101103"  ---------------------------------------------------------------------------
102104"  View the change log after an update or installation.
103105"  ---------------------------------------------------------------------------
104106func !  s: view_changelog ()
105-   call  s: create_changelog ()
106- 
107-   if  ! exists (' g:vundle_changelog_file'  )
108-     let  g: vundle_changelog_file  =  tempname ()
107+   if  ! exists (' s:changelog_file'  )
108+     let  s: changelog_file  =  tempname ()
109109  endif 
110110
111-   call  writefile (g: vundle_changelog , g: vundle_changelog_file )
112-   execute  ' silent pedit '   . g: vundle_changelog_file
111+   if  bufloaded (s: changelog_file )
112+     execute  ' silent bdelete'   s: changelog_file
113+   endif 
114+   call  writefile (s: create_changelog (), s: changelog_file )
115+   execute  ' silent pedit'   s: changelog_file
113116
114117  wincmd  P  | wincmd  H
115118endf 
0 commit comments