mhinz / vim-startify

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

Opens Unnecessary Hidden Buffers When `g:startify_lists` is Set #442

Open Neightro opened 3 years ago

Neightro commented 3 years ago

I have created a minimal vimrc that reproduces this problem: vimrc-startify-only.txt

When batch-loading multiple files, startify creates multiple hidden buffers for files which were selected. The bug only appears to happen g:startify_lists, as omitting this causes Startify to open buffers normally. This behavior appears to be identical between classic Vim and Neovim.

These are the steps I have used to reproduce this problem:

  1. Run [n]vim -u vimrc-startify-only.txt; do not pass any files as arguments.
  2. Scroll down to 'Recent Files' (not the one with the tilde in the name), and place cursor on second element from top. Select that one and the one directly below with 'b'; press enter to open the buffers.
  3. After opening the files, executing :ls! will reveal multiple hidden buffers, with paths matching those of other recent files.

Expected behavior: Startify opens only the two needed files, without creating any hidden buffers.

Edit: I have updated this post to reflect my recent discoveries.

Edit 2: Updated title. I was able to cause this behavior by opening a single buffer through the following steps:

  1. Run with nvim -u vimrc-startify-only.txt
  2. Scroll down to 'Recent Files' and select the first list element
  3. Run ls!