Instructions: Replace the template text and remove irrelevant text (including this line)
Describe the bug
With set completeopt+=preview, a scratch buffer is used that can be "killed" with a :pclose.
If a user is using set completeopt+=popup, a scratch buffer is used, but without an associated preview window. This renders :pclose useless, but :bwipeout! is also ineffective. This mean that :bnext and :bprevious will take the user to the "hidden" scratch buffer. The same scratch buffer is present in the output of :ls.
To Reproduce
Use the following vimrc:
function! Omni(findstart, base) if a:findstart return 0 endif return [ {'word':'foo', 'info': 'bar'} ] endfunction set omnifunc=Omni set completeopt=popup,menuone
bug_vimrc.vimvim -Nu bug_vimrc.vim --nopluginsi<C-x><C-o> - go to insert mode and trigger omnicompletion.<Esc>:ls<CR> - exit insert mode and check the buffer list. Note that The second listed buffer is the [Scratch] buffer.:pclose<CR> - attempt to close the preview. Note that the scratch buffer doesn't have an associated preview window.:ls<CR> - check the buffer list again. Note that the scratch buffer is still there.Expected behavior
Users and/or plugin maintainers should have a way to get rid of the scratch buffer. I'd even argue that the scratch buffer should be thrown away when the completion popup gets closed.
Screenshots
I'm not sure which screenshot would be helpful, if any. I'll gladly provide any requested.
Environment (please complete the following information):
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Nov 15 2020 19:21:07)
Included patches: 1-1989
Compiled by Arch Linux
Huge version with GTK3 GUI. Features included (+) or not (-):
+acl +cmdline_info -farsi +langmap +mouse_sgr +profile +tag_binary +virtualedit
+arabic +comments +file_in_path +libcall -mouse_sysmouse +python/dyn -tag_old_static +visual
+autocmd +conceal +find_in_path +linebreak +mouse_urxvt +python3/dyn -tag_any_white +visualextra
+autochdir +cryptv +float +lispindent +mouse_xterm +quickfix +tcl/dyn +viminfo
-autoservername +cscope +folding +listcmds +multi_byte +reltime +termguicolors +vreplace
+balloon_eval +cursorbind -footer +localmap +multi_lang +rightleft +terminal +wildignore
+balloon_eval_term +cursorshape +fork() +lua/dyn -mzscheme +ruby/dyn +terminfo +wildmenu
+browse +dialog_con_gui +gettext +menu +netbeans_intg +scrollbind +termresponse +windows
++builtin_terms +diff -hangul_input +mksession +num64 +signs +textobjects +writebackup
+byte_offset +digraphs +iconv +modify_fname +packages +smartindent +textprop +X11
+channel +dnd +insert_expand +mouse +path_extra +sound +timers -xfontset
+cindent -ebcdic +ipv6 +mouseshape +perl/dyn +spell +title +xim
+clientserver +emacs_tags +job +mouse_dec +persistent_undo +startuptime +toolbar -xpm
+clipboard +eval +jumplist +mouse_gpm +popupwin +statusline +user_commands +xsmp_interact
+cmdline_compl +ex_extra +keymap -mouse_jsbterm +postscript -sun_workshop +vartabs +xterm_clipboard
+cmdline_hist +extra_search +lambda +mouse_netterm +printer +syntax +vertsplit -xterm_save
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "/etc/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/at-spi-2.0 -pthread -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.32/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lelf -lcanberra -lacl -lattr -lgpm -ldl -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.32/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib -L/usr/lib/perl5/5.32/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm
Note that another user reproduced this bug on a completely different machine.
Additional context
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Can confirm on 8.2.2041
I can reproduce the bug in 8.2.2041 but not in 8.2.2143. With the latter, there is no scratch buffer when doing :ls but it does appear as unlisted when doing :ls!.
I think this was fixed in d356fc6.
With the latter, there is no scratch buffer when doing :ls but it does appear as unlisted when doing :ls!.
That's good enough for me. As far as I'm concerned, this issue can be closed.
Closed #7443.