Closed alek3y closed 1 year ago
Hello. Thank you very much for the feedback, and for doing most of the work by debugging the code. I added a commit that fixes this issue. However, please check if it is working as intended, and feel free if to reopen it if it is not.
Yes, it seems to work as expected. Thanks!
Steps to reproduce:
nvim A B
:bd
onA
A
and press EnterFrom some debugging I found the flow of the program during the last step to be:
on_menu_save
is called to update the marks (likely insidetoggle_quick_menu
because of theBufLeave
event)set_mark_list
runsvim.fn.bufnr("A")
which returns1
instead of-1
despite not being on the listupdate_buffers
is called which doesn't delete norbdadd
s theA
buffer back (becausebufnr
is not-1
)select_menu_item
startsnav_file
which runsupdate_marks
remove_mark(1)
is executed becausebuffer_is_valid
returnsfalse
(sincevim.fn.buflisted(1)
returns0
because it wasn'tbdadd
ed) which effectively undos the last stepThis problem could be avoided by simply using
:bw
instead of:bd
, as the help page mention it doesn't completely delete the buffer, however I think there should be a way to detect if the buffer isnobuflisted
(which seems to be the option set on the buffer after:bd
).This was a little hard to dig out so I hope I got everything right.