[vim/vim] Potential vim bug related to :bd of linked file and opening again

14 views
Skip to first unread message

justrajdeep

unread,
May 27, 2021, 6:55:10 PM5/27/21
to vim_dev
Hi

I have a file and a soft link to it

 
ls -ltr $OUT/src/verif/gl2cc/gl2cc_top/tb/gl2cc_top_tb_pkg.sv
lrwxrwxrwx 1 ramondal gfx11 85 May 27 10:21 $OUT/src/verif/gl2cc/gl2cc_top/tb/gl2cc_top_tb_pkg.sv -> $ROOT/src/verif/glx/gl2cc/gl2cc_top/tb/gl2cc_top_tb_pkg.sv

i open the symlink file using gvim

gvim -u $VIM_HOME/share/vim/vim82/vimrc_example.vim $OUT/src/verif/gl2cc/gl2cc_top/tb/gl2cc_top_tb_pkg.sv

delete the buffer 

:bd

Then i try to open the original file

:e $ROOT/src/verif/glx/gl2cc/gl2cc_top/tb/gl2cc_top_tb_pkg.sv

instead of opening the actual file it again opens the symlink file:

$OUT/src/verif/gl2cc/gl2cc_top/tb/gl2cc_top_tb_pkg.sv

I think this is a bug.

I am using vim 8.2.1523

Thanks in advance :)

Tony Mechelynck

unread,
May 28, 2021, 6:30:27 AM5/28/21
to vim_dev
IIUC you fell upon a documented but little known quirk of Vim, namely,
:bdelete does not delete everything about a buffer; if you want to
forget everything (but maybe more than you want), use :bwipeout

See
:help :bdelete
:help :bwipeout

Best regards,
Tony.

justrajdeep

unread,
May 28, 2021, 5:24:45 PM5/28/21
to vim_dev
Thanks Tony.
Reply all
Reply to author
Forward
0 new messages