barbar.nvim
barbar.nvim copied to clipboard
Buffer tabs appear in reverse order when opening multiple files with Neovim
For instance, when running nvim foo bar baz
in the shell, the buffer tabs order, i.e. baz
, bar
, foo
.
@romgrk I noticed today that buffers still appear in reverse order when sourcing a saved session.
To reproduce:
" init.vim
call plug#begin('~/.vim/bundle')
Plug 'romgrk/barbar.nvim'
call plug#end()
-
> nvim foo bar
-
:mksession test.vim | qa
-
> nvim
-
:source test.vim
- Buffer tabs appear in reverse order:
bar
,foo
Done
@romgrk 3c9493e doesn't seem to solve the issue. I tried out the latest version of barbar.nvim today but the procedure mentioned in my previous comment still makes the buffer tabs appear in reverse order 🤔
Can't reproduce. I'll need more details.
I just updated barbar.nvim to the latest commit 10df6f7.
:version
outputs the following:
NVIM v0.5.0-812-gd17e50879
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-5 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/travis/build/neovim/bot-ci/build/neovim/build/config -I/home/travis/build/neovim/bot-ci/build/neovim/src -I/home/travis/build/neovim/bot-ci/build/neovim/.deps/usr/include -I/usr/include -I/home/travis/build/neovim/bot-ci/build/neovim/build/src/nvim/auto -I/home/travis/build/neovim/bot-ci/build/neovim/build/include
Compiled by travis@travis-job-317a2489-aba5-414a-b9f3-9551746c326c
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/share/nvim"
Run :checkhealth for more info
The steps I used to reproduce the error:
" init.vim
call plug#begin('~/.vim/bundle')
Plug 'romgrk/barbar.nvim'
call plug#end()
-
> nvim foo bar
-
:mksession! test.vim | qa
-
> nvim
-
:source test.vim
- Buffer tabs appear in reverse order:
bar
,foo
Still can't reproduce on my setup. I'll keep the issue open and might give it another look eventually but I have too much work to tell when I'll be able to get back to this. PR welcome if you want to try to fix it.
@romgrk Btw, I noticed that when reproducing the steps above, but doing nvim -c 'source test.vim'
instead of steps 3 and 4 doesn't cause the bug. The buffer tabs only appear in reverse order when editing the buffers from inside of neovim.
Also I'm getting the exact same issue on my Windows machine using the minimal init.vim
above and so it's odd that you can't reproduce the bug 🤔
@romgrk Below is the session file that Neovim generates after I run :mksession
. Perhaps the reason you're not seeing the same bug may be since you get a different session file on :mksession
? Could you try reproducing the bug using this session file please?
let SessionLoad = 1
let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1
let v:this_session=expand("<sfile>:p")
silent only
cd ~/
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
let s:wipebuf = bufnr('%')
endif
set shortmess=aoO
badd +1 foo
badd +0 bar
argglobal
%argdel
edit bar
set splitbelow splitright
set nosplitbelow
set nosplitright
wincmd t
set winminheight=0
set winheight=1
set winminwidth=0
set winwidth=1
argglobal
setlocal fdm=manual
setlocal fde=0
setlocal fmr={{{,}}}
setlocal fdi=#
setlocal fdl=0
setlocal fml=1
setlocal fdn=20
setlocal fen
silent! normal! zE
let s:l = 1 - ((0 * winheight(0) + 21) / 42)
if s:l < 1 | let s:l = 1 | endif
exe s:l
normal! zt
1
normal! 0
tabnext 1
if exists('s:wipebuf') && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal'
silent exe 'bwipe ' . s:wipebuf
endif
unlet! s:wipebuf
set winheight=1 winwidth=20 winminheight=1 winminwidth=1 shortmess=filnxtToOF
let s:sx = expand("<sfile>:p:r")."x.vim"
if filereadable(s:sx)
exe "source " . fnameescape(s:sx)
endif
let &g:so = s:so_save | let &g:siso = s:siso_save
doautoall SessionLoadPost
unlet SessionLoad
" vim: set ft=vim :
Can't reproduce, I get "foo, bar".
That's really odd that you can't reproduce it. What version of Neovim are you using?
v0.5.0-845-gd79335c49
, very recent build
Any update on this thread? I came across this as well
Still in my task list but I don't have enough bandwidth these days, and if I can't reproduce I can't debug. If anyone is interested in debugging further I can explain where to look.
The the interim I've just remapped my buffer navigation to be backwards 😆
I take that back, that solution doesn't always work because it seems barbar is sorting my buffers 😵 💫
Also it seems to me like Ctrl-i and Ctrl-o navigation has been wonky since installing barbar 🤔
File a different issue for the ctrl-i/ctrl-o thing if you have more details.
@melkster does this still happen?
@Iron-E Yes 😕