Shougo / ddc.vim

Dark deno-powered completion framework for Vim/NeoVim
MIT License
672 stars 33 forks source link

Autocomplete does not work at cmdwin even with specialBufferCompletion #95

Closed ujihisa closed 2 years ago

ujihisa commented 2 years ago

Problems summary

Autocomplete does not work at cmdwin even with specialBufferCompletion

Expected

Autocomplete works at cmdwin exactly like other buffers with filetype=vim

Environment Information

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jun 07 2022 00:51:41) Included patches: 1-5046 Compiled by Arch Linux Huge version with GTK3 GUI. Features included (+) or not (-): +acl +comments +find_in_path +lispindent +multi_byte +rightleft +terminal +wildignore +arabic +conceal +float +listcmds +multi_lang +ruby/dyn +terminfo +wildmenu +autocmd +cryptv +folding +localmap -mzscheme +scrollbind +termresponse +windows +autochdir +cscope -footer +lua/dyn +netbeans_intg +signs +textobjects +writebackup -autoservername +cursorbind +fork() +menu +num64 +smartindent +textprop +X11 +balloon_eval +cursorshape +gettext +mksession +packages -sodium +timers -xfontset +balloon_eval_term +dialog_con_gui -hangul_input +modify_fname +path_extra +sound +title +xim +browse +diff +iconv +mouse +perl/dyn +spell +toolbar -xpm ++builtin_terms +digraphs +insert_expand +mouseshape +persistent_undo +startuptime +user_commands +xsmp_interact +byte_offset +dnd +ipv6 +mouse_dec +popupwin +statusline +vartabs +xterm_clipboard +channel -ebcdic +job +mouse_gpm +postscript -sun_workshop +vertsplit -xterm_save +cindent +emacs_tags +jumplist -mouse_jsbterm +printer +syntax +vim9script
+clientserver +eval +keymap +mouse_netterm +profile +tag_binary +viminfo
+clipboard +ex_extra +lambda +mouse_sgr -python -tag_old_static +virtualedit
+cmdline_compl +extra_search +langmap -mouse_sysmouse +python3/dyn -tag_any_white +visual
+cmdline_hist -farsi +libcall +mouse_urxvt +quickfix +tcl/dyn +visualextra
+cmdline_info +file_in_path +linebreak +mouse_xterm +reltime +termguicolors +vreplace
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/sysprof-4 -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/lzo -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 -fexceptions -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/vim/src=/usr/src/debug -flto=auto -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,--no-as-needed -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.36/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto -L/usr/local/lib -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 -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.36/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto -fstack-protector-strong -L/usr/local/lib -L/usr/lib/perl5/5.36/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm


- `:checkhealth` or `:CheckHealth` result(neovim only):

## Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

```vim
" git/config/_vimrc_mini
set nocompatible

if has('vim_starting')
  set runtimepath+=~/.vimbundles/neobundle.vim
endif

call neobundle#begin(expand('~/.vimbundles'))

let g:neobundle#enable_name_conversion = 1
NeoBundle 'vim-denops/denops.vim'
NeoBundle 'Shougo/ddc.vim'
NeoBundle 'LumaKernel/ddc-file'

call neobundle#end()

filetype plugin indent on

function! s:init_ddc()
  let l:sources = []

  call ddc#custom#patch_global('completionMode', 'popupmenu')
  call ddc#custom#patch_global('specialBufferCompletion', v:true)
  let l:sources += ['file']
  call ddc#custom#patch_global('sourceOptions', {
        \ 'file': {
        \   'mark': 'F',
        \   'isVolatile': v:true,
        \   'forceCompletionPattern': '/\S*',
        \ }})
  call ddc#custom#patch_global('sources', l:sources)
  " call ddc#enable_cmdline_completion()
  call ddc#enable()
endfunction

call s:init_ddc()

How to reproduce the problem from neovim/Vim startup (Required!)

  1. Open vim
  2. Type i./
  3. Observe that Vim automatically pops up the candidates of files under the current directory
  4. Type <Esc>q:i./
  5. Observe that Vim does not pop up anything.

Screenshot (if possible)

https://gyazo.com/1dc0f415546053d8f7c378844cd9794e

Shougo commented 2 years ago

I don't want to enable the feature because I don't want to support command line window behavior.

But OK. I have removed the check. Note; I may re-disable the feature.

ujihisa commented 2 years ago

Confirmed that 57907990b2b35f2dfed9e40901cc71730a2181db fixed the issue.

Hmm, one of the main reasons why I use ddc is to auto-complete filenames at cmdwin though.. But yes I get the idea, since the cmdwin is so restricted.