Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank nvim-tree when opening a session from Startify/Dashboard - session related #488

Closed
imreverse opened this issue Jul 4, 2021 · 2 comments · Fixed by #967
Closed

Comments

@imreverse
Copy link

Whenever I try to load a session from Startify (from the sessionlist) or Dashboard (using sessionsave and sessionload), nvim-tree always shows a blank window.
I save and retrieve my sessions using the following commands,

nnoremap <Leader>ss :source     $HOME/.config/nvim/session/
nnoremap <Leader>sv :mksession! $HOME/.config/nvim/session/

If I try to load a session using the above source command, nvim-tree toggle behaves as expected and shows the directory of the session.

Here is the config which is able to reproduce the above error.

call plug#begin('~/.config/nvim/plug')
Plug 'kyazdani42/nvim-tree.lua'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'mhinz/vim-startify'
call plug#end()
nnoremap <A-e> :NvimTreeToggle<CR>
nnoremap <Leader>ss :source $HOME/.config/nvim/session/
nnoremap <Leader>sv :mksession! $HOME/.config/nvim/session/
let g:startify_files_number = 7
let g:startify_session_dir="$HOME/.config/nvim/session"
let g:startify_lists = [
      \ { 'type': 'bookmarks', 'header': ['   Bookmarks']      },
      \ { 'type': 'sessions',  'header': ['   Sessions']       },
      \ { 'type': 'files',     'header': ['   MRU']            },
      \ { 'type': 'commands',  'header': ['   Commands']       },
      \ ]

I have tried this using Packer and Plug both, yet the problem persists.
I also have tried nerdtree, and it works as expected.

@kyazdani42
Copy link
Member

hi, does this still happen ?

@imreverse
Copy link
Author

Hey, yep the problem still remains. However someone commented on this for a hacky fix, although they deleted their comment later. The hacky fix was to do NvimTreeRefresh before any NvimTreeToggle, and it works.

@kyazdani42 kyazdani42 changed the title Blank nvim-tree when opening a session from Startify/Dashboard Blank nvim-tree when opening a session from Startify/Dashboard - session related Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants