Open subratappt opened 7 months ago
Preview is, as the name suggests, a preview window and not meant to be used for editing. The previewed file content is only temporary generated so press enter or any other key you registered to open the file (just like when you don't have preview window opened) and you are good to go.
Regarding the name of the buffer, that [No Name] refers to the buffer that was opened there from before. The preview window is just a temporary overlay that covers 100% size of the window.
You might understand what's going on better with :Neotree float
's preview window.
@pysan3 Thanks for your reply. When using the "use_float"=true
, it is just creating the borders and "NeoTree Preview" title; otherwise the behavior is the same with "use_float"=false
.
We can accept the behavior with float
, because when the preview is opened in the float window, there should not be any confusion about which file you opened.
But the confusion comes with the "use_float"=false
condition; it shows the preview on top of the existing buffer name (buffer tab). It should show the preview with the temp buffer name on a new buffer tab.
But the confusion comes with the
"use_float"=false
condition; it shows the preview on top of the existing buffer name (buffer tab). It should show the preview with the temp buffer name on a new buffer tab.
The buffer name you are seeing is coming from whatever tabline plugin (eg bufferline.nvim, nvim-cokeline, nougat.nvim, ...) you installed.
Those plugins should order the listed buffers (see :h 'buflisted'
). If you load multiple buffers, you'll see that it is just a horizontal list of all opened buffers that has nothing to do with the current window.
To keep it short, the top line in vim is used to list all real opened buffers.
I said real here since neo-tree preview is not really opening the buffer for editing but only for previewing (:h 'nobuflisted'
) so this is expected.
In fact, if you use bufferline.nvim, you should see all buffer names dimmed (the color of init.lua
in the first GIF in bufferline.nvim) meaning that all are not in focus.
We do not control what is shown in the tabline and tabline plugins are doing their job to show a horizontal list of all listed buffers (in your case, there's only one buffer which might make it unclear tho).
If you really don't want to see that line :h showtabline
might help you.
Did you check docs and existing issues?
Neovim Version (nvim -v)
NVIM v0.9.2
Operating System / Version
Centos 6
Describe the Bug
I am using the TAB key to preview the file, like NvimTree. Though it shows the file preview, it doesn't show the buffer title. Also, I can go to the preview buffer and edit it. However, when I go to the previous/next buffer, the preview buffer is lost, which is unsaved.
Screenshots, Traceback
Steps to Reproduce
Expected Behavior
It should show the preview of the file on the right side, with the buffer title (name of the file on the buffer line).
Your Configuration