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

Buffer tabs appear in reverse order when opening multiple files with Neovim #31

Open
mawkler opened this issue Oct 31, 2020 · 21 comments
Open
Labels
bug Something isn't working needs-repro Minimal reproduction is needed.
Milestone

Comments

@mawkler
Copy link
Contributor

mawkler commented Oct 31, 2020

For instance, when running nvim foo bar baz in the shell, the buffer tabs order, i.e. baz, bar, foo.

@romgrk romgrk closed this as completed in 1258cbf Nov 1, 2020
@mawkler
Copy link
Contributor Author

mawkler commented Nov 6, 2020

@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()
  1. > nvim foo bar
  2. :mksession test.vim | qa
  3. > nvim
  4. :source test.vim
  5. Buffer tabs appear in reverse order: bar, foo

@romgrk romgrk reopened this Nov 6, 2020
@romgrk romgrk closed this as completed in 7d3858e Nov 7, 2020
@romgrk
Copy link
Owner

romgrk commented Nov 7, 2020

Done

@mawkler
Copy link
Contributor Author

mawkler commented Nov 10, 2020

@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 🤔

@romgrk
Copy link
Owner

romgrk commented Nov 10, 2020

Can't reproduce. I'll need more details.

@mawkler
Copy link
Contributor Author

mawkler commented Nov 10, 2020

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()
  1. > nvim foo bar
  2. :mksession! test.vim | qa
  3. > nvim
  4. :source test.vim
  5. Buffer tabs appear in reverse order: bar, foo

@romgrk
Copy link
Owner

romgrk commented Nov 10, 2020

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 romgrk reopened this Nov 10, 2020
@mawkler
Copy link
Contributor Author

mawkler commented Nov 15, 2020

@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 🤔

@mawkler
Copy link
Contributor Author

mawkler commented Nov 21, 2020

@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 :

@romgrk
Copy link
Owner

romgrk commented Nov 21, 2020

Can't reproduce, I get "foo, bar".

@mawkler
Copy link
Contributor Author

mawkler commented Nov 21, 2020

That's really odd that you can't reproduce it. What version of Neovim are you using?

@romgrk
Copy link
Owner

romgrk commented Nov 21, 2020

v0.5.0-845-gd79335c49, very recent build

@SalTor
Copy link

SalTor commented Apr 6, 2021

Any update on this thread? I came across this as well

@romgrk
Copy link
Owner

romgrk commented Apr 6, 2021

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.

@SalTor
Copy link

SalTor commented Apr 6, 2021

The the interim I've just remapped my buffer navigation to be backwards 😆

@SalTor
Copy link

SalTor commented Apr 6, 2021

I take that back, that solution doesn't always work because it seems barbar is sorting my buffers 😵 💫

@SalTor
Copy link

SalTor commented Apr 6, 2021

Also it seems to me like Ctrl-i and Ctrl-o navigation has been wonky since installing barbar 🤔

@romgrk
Copy link
Owner

romgrk commented Apr 7, 2021

File a different issue for the ctrl-i/ctrl-o thing if you have more details.

@Iron-E
Copy link
Collaborator

Iron-E commented May 27, 2022

@melkster does this still happen?

@mawkler
Copy link
Contributor Author

mawkler commented May 27, 2022

@Iron-E Yes 😕

@Iron-E Iron-E added the bug Something isn't working label Jun 6, 2022
@Iron-E Iron-E added this to the unplanned milestone Apr 9, 2023
@Iron-E Iron-E added the needs-repro Minimal reproduction is needed. label Apr 28, 2023
@ncorbuk
Copy link

ncorbuk commented May 30, 2024

im not even seeing buffer tabs 😢

@Iron-E
Copy link
Collaborator

Iron-E commented May 30, 2024

im not even seeing buffer tabs 😢

Can you open a separate issue about this? Additional details like Nvim version, platform, barbar config, and/or minimal reproduction would be helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-repro Minimal reproduction is needed.
Projects
None yet
Development

No branches or pull requests

5 participants