Loading ...
Sorry, an error occurred while loading the content.

Custom completion bug in patch 7.1.104

Expand Messages
  • Erik Falor
    I have written a custom completion function that runs a system command to generate a list of possible completions. I use it from within input() and with
    Message 1 of 2 , Nov 6, 2007
    • 0 Attachment
      I have written a custom completion function that runs a system command to generate a list of possible completions.  I use it from within input() and with various commands.  Prior to patch 7.1.104 it worked as expected.  

      However, ever since I applied patch 7.1.104, pressing Tab a second time after the first completion suggestion is given does not cycle through the list of alternatives.

      To be more specific, I should say that I cache the results of the external command so that the next time I bring up the prompt, I don't have to re-run that program again.  When the completion function fetches the list from memory, everything behaves.  It is only when it must go to the external program again that the prompt disregards my pressing Tab.

      Attached is a simple script that uses the output of the 'ls' program to provide completions to input() and to a command.  It works as expected with binaries > 7.1.104.  It appears that 7.1.095 is related to  7.1.104, and the changes put in place in that 
      patch also work correctly.

      Here is my version info:

      VIM - Vi IMproved 7.1 (2007 May 12, compiled Oct 30 2007 11:19:11)
      MS-Windows 32 bit GUI version with OLE support
      Included patches: 1-76, 78-104
      Compiled by efalor@SPILLMAN
      Huge version with GUI. Features included (+) or not (-):
      +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
      +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
      +cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs -dnd -ebcdic
      +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
      +folding -footer +gettext/dyn -hangul_input +iconv/dyn +insert_expand +jumplist
      +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
      +mksession +modify_fname +mouse +mouseshape +multi_byte +multi_lang -mzscheme
      +netbeans_intg +ole -osfiletype +path_extra +perl/dyn -postscript +printer
      +profile +python/dyn +quickfix +reltime +rightleft +ruby/dyn +scrollbind +signs
      +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary
      +tag_old_static -tag_any_white -tcl -tgetent -termresponse +textobjects +title
      +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
      +vreplace +wildignore +wildmenu +windows +writebackup -xfontset -xim
      -xterm_save -xpm_w32
      system vimrc file: "$VIM\vimrc"
      user vimrc file: "$HOME\_vimrc"
      2nd user vimrc file: "$VIM\_vimrc"
      user exrc file: "$HOME\_exrc"
      2nd user exrc file: "$VIM\_exrc"
      system gvimrc file: "$VIM\gvimrc"
      user gvimrc file: "$HOME\_gvimrc"
      2nd user gvimrc file: "$VIM\_gvimrc"
      system menu file: "$VIMRUNTIME\menu.vim"
      Compilation: cl -c /W3 /nologo -D_MT -MT -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 /Fo.\ObjGOLYR/ /Ox -DNDEBUG /G7 /arch:SSE2 -DFEAT_OLE -DFEAT_GUI_W32 -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\" python25.dll\" -DFEAT_PERL -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl58.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=18 -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby18.dll\" -DFEAT_HUGE /Zi /Fd.\ObjGOLYR/
      Linking: link /RELEASE /nologo /subsystem:windows /incremental:no /nodefaultlib:libc advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib oldnames.lib kernel32.lib gdi32.lib version.lib winspool.lib comctl32.lib advapi32.lib shell32.lib /machine:i386 /nodefaultlib libcmt.lib oleaut32.lib user32.lib /nodefaultlib:python25.lib WSock32.lib /PDB:gvim.pdb -debug


      --
      Registered Linux User #445632
      http://counter.li.org
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---

    • Erik Falor
      I have written a custom completion function that runs an external program to generate a list of possible completions. I call it from within input() and use it
      Message 2 of 2 , Nov 7, 2007
      • 0 Attachment
        I have written a custom completion function that runs an external program to

        generate a list of possible completions. I call it from within input() and use
        it to provide completion to commands.

        After I applied patch 7.1.104, pressing Tab the second time after the first
        completion suggestion is given does not cycle through the list of alternatives.
        Instead, it looks like it is running the external command all over again, and
        putting the first suggestion back into the prompt.

        The custom completion function caches the results of the external command so
        that the /next/ time I bring up the prompt, it doesn't have to run that program
        again. When the completion function fetches the list from memory, it behaves. It
        is only when it must go to the external program that the prompt fails to cycle
        through the list of items returned by the external program.

        Just in case you do not have a plugin which provides a custom completion
        function that uses an external program, I have attached a simple script that
        emulates my real-life plugin. It uses the output of the 'echo' program to
        provide completions to input() and to a command. One mapping uses a completion
        function that caches the results, and another does not cache the results to give
        you a feel for the difference.

        Patch 7.1.095 is related to 7.1.104, but those changes do not exhibit this bug.

        This is my version info:

        VIM - Vi IMproved 7.1 (2007 May 12, compiled Oct 30 2007 11:19:11)
        MS-Windows 32 bit GUI version with OLE support
        Included patches: 1-76, 78-104
        Compiled by efalor@SPILLMAN
        Huge version with GUI. Features included (+) or not (-):
        +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
        +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
        +cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs -dnd -ebcdic
        +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
        +folding -footer +gettext/dyn -hangul_input +iconv/dyn +insert_expand +jumplist
        +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
        +mksession +modify_fname +mouse +mouseshape +multi_byte +multi_lang -mzscheme
        +netbeans_intg +ole -osfiletype +path_extra +perl/dyn -postscript +printer
        +profile +python/dyn +quickfix +reltime +rightleft +ruby/dyn +scrollbind +signs
        +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary
        +tag_old_static -tag_any_white -tcl -tgetent -termresponse +textobjects +title
        +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
        +vreplace +wildignore +wildmenu +windows +writebackup -xfontset -xim
        -xterm_save -xpm_w32
        system vimrc file: "$VIM\vimrc"
        user vimrc file: "$HOME\_vimrc"
        2nd user vimrc file: "$VIM\_vimrc"
        user exrc file: "$HOME\_exrc"
        2nd user exrc file: "$VIM\_exrc"
        system gvimrc file: "$VIM\gvimrc"
        user gvimrc file: "$HOME\_gvimrc"
        2nd user gvimrc file: "$VIM\_gvimrc"
        system menu file: "$VIMRUNTIME\menu.vim"
        Compilation: cl -c /W3 /nologo -D_MT -MT -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 /Fo.\ObjGOLYR/ /Ox -DNDEBUG /G7 /arch:SSE2 -DFEAT_OLE -DFEAT_GUI_W32 -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\" python25.dll\" -DFEAT_PERL -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl58.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=18 -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby18.dll\" -DFEAT_HUGE /Zi /Fd.\ObjGOLYR/
        Linking: link /RELEASE /nologo /subsystem:windows /incremental:no /nodefaultlib:libc advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib oldnames.lib kernel32.lib gdi32.lib version.lib winspool.lib comctl32.lib advapi32.lib shell32.lib /machine:i386 /nodefaultlib libcmt.lib oleaut32.lib user32.lib /nodefaultlib:python25.lib WSock32.lib /PDB:gvim.pdb -debug


        --
        Registered Linux User #445632
        http://counter.li.org




        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---

      Your message has been successfully submitted and would be delivered to recipients shortly.