mhinz / vim-startify

:link: The fancy start screen for Vim.
MIT License
5.3k stars 186 forks source link

Navigating to folder bookmark/restore session bug #231

Closed amadeus closed 8 years ago

amadeus commented 8 years ago

I have noticed a small, but kind of annoying bug, and I've been able to isolate the issue to being caused by Startify.

For reference, I have the following vim configuration related to sessions and Startify:

set sessionoptions=buffers,help,tabpages
let g:startify_bookmarks = ['/Users/amadeus/Development/discord/discord_app', '/Users/amadeus/Development/discord/discord_api']
let g:startify_session_autoload = 1
let g:startify_change_to_dir = 1
let g:ctrlp_reuse_window = 'startify'
let g:startify_list_order = ['bookmarks', 'files']
let g:startify_skiplist = [
  \ 'COMMIT_EDITMSG',
  \ $VIMRUNTIME .'/doc',
  \ 'bundle/.*/doc',
  \ '\.DS_Store'
  \ ]

Lets assume for the example of this scenario that I have a session stored in Session.vim inside the first bookmark. I only have one file open in that session, if I do :ls I get the following output:

:ls
  3 %a   "TODO.md"                      line 55      

Everything looks good. If I close vim, and open a new vim, cd into that directory manually, run :source Session.py and then run :ls again, the output is exactly the same.

However, if I close vim, and select that Startify bookmark it appears to restore the session properly, however, if I run :ls I get the following output:

:ls
  2 #h   "~/Development/discord/discord_app" line 1
  3 %a   "TODO.md"                      line 55   

It appears to create a sort of phantom directory buffer before restoring the session.

mhinz commented 8 years ago

Oh, well. Bookmarks are registered as normal files, so :edit ~/Development/discord/discord_app is executed and afterwards the user options are checked, session_autoload in this case.

I'll see how to fix this properly. Thanks for reporting!

amadeus commented 8 years ago

Maybe just a new section called startify_folder_bookmarks or something?

amadeus commented 8 years ago

or it could be like, startify_project_bookmarks or something. Then existing functionality isn't messed with

mhinz commented 8 years ago

It should work now!

amadeus commented 8 years ago

Awesome, works great, thanks!