Browse Source

Fix autoloading of sessions from bookmarked directories

References #144.
Marco Hinz 11 years ago
parent
commit
362fa1d957
2 changed files with 5 additions and 1 deletions
  1. 3 1
      autoload/startify.vim
  2. 2 0
      doc/startify.txt

+ 3 - 1
autoload/startify.vim

@@ -570,7 +570,9 @@ function! s:check_user_options() abort
   let session = path . s:sep .'Session.vim'
   let session = path . s:sep .'Session.vim'
 
 
   " change to VCS root directory
   " change to VCS root directory
-  if get(g:, 'startify_change_to_vcs_root')
+  if get(g:, 'startify_session_autoload') && filereadable(session)
+    execute 'source' session
+  elseif get(g:, 'startify_change_to_vcs_root')
     call s:cd_to_vcs_root(path)
     call s:cd_to_vcs_root(path)
   " change directory
   " change directory
   elseif get(g:, 'startify_change_to_dir', 1)
   elseif get(g:, 'startify_change_to_dir', 1)

+ 2 - 0
doc/startify.txt

@@ -198,6 +198,8 @@ If you fire up "vim" in a directory that contains a "Session.vim", that session
 will be loaded automatically. Otherwise it will be shown as the top entry in
 will be loaded automatically. Otherwise it will be shown as the top entry in
 the Startify buffer.
 the Startify buffer.
 
 
+This also works if you open a bookmarked directory.
+
 Great way to create a portable project folder.
 Great way to create a portable project folder.
 
 
 ------------------------------------------------------------------------------
 ------------------------------------------------------------------------------