]> granicus.if.org Git - vim/commitdiff
updated for version 7.0153
authorBram Moolenaar <Bram@vim.org>
Mon, 3 Oct 2005 22:02:18 +0000 (22:02 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 3 Oct 2005 22:02:18 +0000 (22:02 +0000)
28 files changed:
runtime/doc/eval.txt
runtime/doc/insert.txt
runtime/doc/options.txt
runtime/doc/starting.txt
runtime/doc/syntax.txt
runtime/doc/tags
runtime/menu.vim
src/Make_bc3.mak
src/Make_cyg.mak
src/Make_dice.mak
src/Make_manx.mak
src/Make_ming.mak
src/Make_mpw.mak
src/Make_os2.mak
src/Make_ro.mak
src/Make_sas.mak
src/Make_w16.mak
src/Makefile
src/edit.c
src/ex_getln.c
src/fileio.c
src/gui.c
src/option.c
src/option.h
src/screen.c
src/syntax.c
src/testdir/test32.in
src/version.h

index fa51c2a0403dddf1383b0fc848f060ccde45d31d..a06b6f65fc2fbc60249a578ff6b34e090cba9a13 100644 (file)
@@ -1,4 +1,4 @@
-*eval.txt*      For Vim version 7.0aa.  Last change: 2005 Sep 29
+*eval.txt*      For Vim version 7.0aa.  Last change: 2005 Oct 02
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1372,6 +1372,14 @@ v:progname       Contains the name (with path removed) with which Vim was
 v:register     The name of the register supplied to the last normal mode
                command.  Empty if none were supplied. |getreg()| |setreg()|
 
+                                       *v:scrollstart* *scrollstart-variable*
+v:scrollstart  String describing the script or function that caused the
+               screen to scroll up.  It's only set when it is empty, thus the
+               first reason is remembered.  It is set to "Unknown" for a
+               typed command.
+               This can be used to find out why your script causes the
+               hit-enter prompt.
+
                                        *v:servername* *servername-variable*
 v:servername   The resulting registered |x11-clientserver| name if any.
                Read-only.
index f668c0093686ebbc396f48a705697a54639c4684..4b6d0eb6f57f09670e40bb11780dbef1e5840680 100644 (file)
@@ -1,4 +1,4 @@
-*insert.txt*    For Vim version 7.0aa.  Last change: 2005 Sep 23
+*insert.txt*    For Vim version 7.0aa.  Last change: 2005 Oct 02
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -952,6 +952,27 @@ CTRL-P                     Find previous match for words that start with the
                        other contexts unless a double CTRL-X is used.
 
 
+INSERT COMPLETION POPUP MENU                           *ins-completion-menu*
+
+Vim can display the matches in a simplistic popup menu.
+
+The menu is used when:
+- The 'completeopt' option contains "menu".
+- The terminal supports at least 8 colors.
+- There are at least two matches.
+
+While the menu is displayed these keys have a special meaning:
+<CR> and <Enter>: Accept the currently selected match
+<Up>:             Select the previous match, as if CTRL-P was used
+<Down>:           Select the next match, as if CTRL-N was used
+
+The colors of the menu can be changed with these highlight groups:
+Pmenu          normal item  |hl-Pmenu|
+PmenuSel       selected item  |hl-PmenuSel|
+PmenuSbar      scrollbar  |hl-PmenuSbar|
+PmenuThumb     thumb of the scrollbar  |hl-PmenuThumb|
+
+
 Filetype-specific remarks for omni completion      *compl-omni-filetypes*
 
 C                                                      *ft-c-omni*
index 34000948e4af61a21ec4fcbf284fb4a04d35dab0..50bae207d8767a16c5f91ad66bb7b842fe537067 100644 (file)
@@ -1,4 +1,4 @@
-*options.txt*  For Vim version 7.0aa.  Last change: 2005 Sep 28
+*options.txt*  For Vim version 7.0aa.  Last change: 2005 Oct 02
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1683,6 +1683,18 @@ A jump table for the options with a short description can be found at |Q_op|.
                set completefunc=CompleteMonths
 <
 
+                                               *'completeopt'* *'cot'*
+'completeopt' 'cot'    string  (default: "menu")
+                       global
+                       {not in Vi}
+       Options for Insert mode completion |ins-completion|.
+       Currently the only supported value is:
+
+          menu     Use a popup menu to show the possible completions.  The
+                   menu is only shown when there is more than one match and
+                   sufficient colors are available.  |ins-completion-menu|
+
+
                                *'confirm'* *'cf'* *'noconfirm'* *'nocf'*
 'confirm' 'cf'         boolean (default off)
                        global
@@ -3382,7 +3394,9 @@ A jump table for the options with a short description can be found at |Q_op|.
                                     f:Folded,F:FoldColumn,A:DiffAdd,
                                     C:DiffChange,D:DiffDelete,T:DiffText,
                                     >:SignColumn,B:SpellBad,P:SpellCap,
-                                    R:SpellRare,L:SpellLocal")
+                                    R:SpellRare,L:SpellLocal,
+                                    +:Pmenu,=:PmenuSel,
+                                    x:PmenuSbar,X:PmenuThumb")
                        global
                        {not in Vi}
        This option can be used to set highlighting mode for various
@@ -3423,6 +3437,10 @@ A jump table for the options with a short description can be found at |Q_op|.
        |hl-SpellCap|    P  word that should start with capital|spell|
        |hl-SpellRare|   R  rare word |spell|
        |hl-SpellLocal|  L  word from other region |spell|
+       |hl-Pmenu|       +  popup menu normal line
+       |hl-PmenuSel|    =  popup menu normal line
+       |hl-PmenuSbar|   x  popup menu scrollbar
+       |hl-PmenuThumb|  X  popup menu scrollbar thumb
 
        The display modes are:
                r       reverse         (termcap entry "mr" and "me")
index 7335d30a0da5da5238d89bfdeb0a2216ecc96546..dcd83b7872582b445c03cf03c1009aef35ab88e8 100644 (file)
@@ -1,4 +1,4 @@
-*starting.txt*  For Vim version 7.0aa.  Last change: 2005 Jun 30
+*starting.txt*  For Vim version 7.0aa.  Last change: 2005 Oct 02
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -789,10 +789,11 @@ accordingly.  Vim proceeds in this order:
 
 4. Load the plugin scripts.                                    *load-plugins*
        This does the same as the command: >
-               :runtime! plugin/*.vim
+               :runtime! plugin/**/*.vim
 <      The result is that all directories in the 'runtimepath' option will be
        searched for the "plugin" sub-directory and all files ending in ".vim"
-       will be sourced (in alphabetical order per directory).
+       will be sourced (in alphabetical order per directory), also in
+       subdirectories.
        Loading plugins won't be done when:
        - The 'loadplugins' option was reset in a vimrc file.
        - The |--noplugin| command line argument is used.
index 021a158af9edc841015b59c4034a2253cbca1eff..17bc63517eae64f3d93e051a648813f8628f6990 100644 (file)
@@ -1,4 +1,4 @@
-*syntax.txt*   For Vim version 7.0aa.  Last change: 2005 Sep 27
+*syntax.txt*   For Vim version 7.0aa.  Last change: 2005 Oct 02
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -3926,6 +3926,14 @@ NonText          '~' and '@' at the end of the window, characters from
                doesn't fit at the end of the line).
                                                        *hl-Normal*
 Normal         normal text
+                                                       *hl-Pmenu*
+Pmenu          Popup menu: normal item.
+                                                       *hl-PmenuSel*
+PmenuSel       Popup menu: selected item.
+                                                       *hl-PmenuSbar*
+PmenuSbar      Popup menu: scrollbar.
+                                                       *hl-PmenuThumb*
+PmenuThumb     Popup menu: Thumb of the scrollbar.
                                                        *hl-Question*
 Question       |hit-enter| prompt and yes/no questions
                                                        *hl-Search*
index 44e189a3f81fa2ed3af99e3f26946ca382ff9b78..31c5f161d91c9597887ba11144db12957f2ed343 100644 (file)
@@ -120,10 +120,12 @@ $VIMRUNTIME       starting.txt    /*$VIMRUNTIME*
 'compatible'   options.txt     /*'compatible'*
 'complete'     options.txt     /*'complete'*
 'completefunc' options.txt     /*'completefunc'*
+'completeopt'  options.txt     /*'completeopt'*
 'confirm'      options.txt     /*'confirm'*
 'consk'        options.txt     /*'consk'*
 'conskey'      options.txt     /*'conskey'*
 'copyindent'   options.txt     /*'copyindent'*
+'cot'  options.txt     /*'cot'*
 'cp'   options.txt     /*'cp'*
 'cpo'  options.txt     /*'cpo'*
 'cpoptions'    options.txt     /*'cpoptions'*
@@ -5353,6 +5355,10 @@ hl-ModeMsg       syntax.txt      /*hl-ModeMsg*
 hl-MoreMsg     syntax.txt      /*hl-MoreMsg*
 hl-NonText     syntax.txt      /*hl-NonText*
 hl-Normal      syntax.txt      /*hl-Normal*
+hl-Pmenu       syntax.txt      /*hl-Pmenu*
+hl-PmenuSbar   syntax.txt      /*hl-PmenuSbar*
+hl-PmenuSel    syntax.txt      /*hl-PmenuSel*
+hl-PmenuThumb  syntax.txt      /*hl-PmenuThumb*
 hl-Question    syntax.txt      /*hl-Question*
 hl-Scrollbar   syntax.txt      /*hl-Scrollbar*
 hl-Search      syntax.txt      /*hl-Search*
@@ -5546,6 +5552,7 @@ inputrestore()    eval.txt        /*inputrestore()*
 inputsave()    eval.txt        /*inputsave()*
 inputsecret()  eval.txt        /*inputsecret()*
 ins-completion insert.txt      /*ins-completion*
+ins-completion-menu    insert.txt      /*ins-completion-menu*
 ins-expandtab  insert.txt      /*ins-expandtab*
 ins-reverse    rileft.txt      /*ins-reverse*
 ins-smarttab   insert.txt      /*ins-smarttab*
@@ -6363,6 +6370,7 @@ scroll.txt        scroll.txt      /*scroll.txt*
 scrollbind-quickadj    scroll.txt      /*scrollbind-quickadj*
 scrollbind-relative    scroll.txt      /*scrollbind-relative*
 scrolling      scroll.txt      /*scrolling*
+scrollstart-variable   eval.txt        /*scrollstart-variable*
 sdl.vim        syntax.txt      /*sdl.vim*
 search()       eval.txt        /*search()*
 search-commands        pattern.txt     /*search-commands*
@@ -6948,6 +6956,7 @@ v:prevcount       eval.txt        /*v:prevcount*
 v:profiling    eval.txt        /*v:profiling*
 v:progname     eval.txt        /*v:progname*
 v:register     eval.txt        /*v:register*
+v:scrollstart  eval.txt        /*v:scrollstart*
 v:servername   eval.txt        /*v:servername*
 v:shell_error  eval.txt        /*v:shell_error*
 v:statusmsg    eval.txt        /*v:statusmsg*
@@ -7324,6 +7333,13 @@ zf       fold.txt        /*zf*
 zg     spell.txt       /*zg*
 zh     scroll.txt      /*zh*
 zi     fold.txt        /*zi*
+zip    zip.txt /*zip*
+zip-contents   zip.txt /*zip-contents*
+zip-copyright  zip.txt /*zip-copyright*
+zip-history    zip.txt /*zip-history*
+zip-manual     zip.txt /*zip-manual*
+zip-usage      zip.txt /*zip-usage*
+zip.txt        zip.txt /*zip.txt*
 zj     fold.txt        /*zj*
 zk     fold.txt        /*zk*
 zl     scroll.txt      /*zl*
index f4ed1b5283a14910c3ef08e91db4e5b68584e153..1a221bff35e7d9c8a917b5fc323c503299536e65 100644 (file)
@@ -2,7 +2,7 @@
 " You can also use this as a start for your own set of menus.
 "
 " Maintainer:  Bram Moolenaar <Bram@vim.org>
-" Last Change: 2005 Aug 16
+" Last Change: 2005 Oct 01
 
 " Note that ":an" (short for ":anoremenu") is often used to make a menu work
 " in all modes and avoid side effects from mappings defined by the user.
@@ -902,7 +902,7 @@ if has("spell")
     endif
 
     let curcol = col('.')
-    let w = spellbadword()
+    let [w, a] = spellbadword()
     if col('.') > curcol               " don't use word after the cursor
       let w = ''
       call cursor(0, curcol)   " put the cursor back where it was
index 207b861a8b15c96ff8b5ec026f98f365fff66fcd..20a9b1fee343490b14fd921c45d3b9c19c1bb48b 100644 (file)
@@ -80,6 +80,7 @@ EXE_dependencies = \
        normal.obj \
        ops.obj \
        option.obj \
+       popupmenu.obj \
        quickfix.obj \
        regexp.obj \
        screen.obj \
index 880f29234051a7a81579a31f0344a6ea6d511563..5879f1ddb67e73f4d4e5e6504e44f303cea6fadb 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Makefile for VIM on Win32, using Cygnus gcc
-# Last updated by Dan Sharp.  Last Change: 2005 Jul 23
+# Last updated by Dan Sharp.  Last Change: 2005 Oct 01
 #
 # Also read INSTALLpc.txt!
 #
@@ -421,6 +421,7 @@ OBJ = \
        $(OUTDIR)/os_win32.o \
        $(OUTDIR)/os_mswin.o \
        $(OUTDIR)/pathdef.o \
+       $(OUTDIR)/popupmenu.o \
        $(OUTDIR)/quickfix.o \
        $(OUTDIR)/regexp.o \
        $(OUTDIR)/screen.o \
index fe74f520eda10ad7c74e84ef756856264732f6d2..b4e1709ec8f467b47b2b2e8257018fc2bdadb43f 100644 (file)
@@ -56,6 +56,7 @@ SRC = \
        ops.c \
        option.c \
        os_amiga.c \
+       popupmenu.c \
        quickfix.c \
        regexp.c \
        screen.c \
@@ -99,6 +100,7 @@ OBJ =        o/buffer.o \
        o/ops.o \
        o/option.o \
        o/os_amiga.o \
+       o/popupmenu.o \
        o/quickfix.o \
        o/regexp.o \
        o/screen.o \
@@ -196,6 +198,8 @@ o/option.o: option.c  $(SYMS)
 
 o/os_amiga.o:  os_amiga.c  $(SYMS) os_amiga.h
 
+o/popupmenu.o: popupmenu.c  $(SYMS)
+
 o/quickfix.o:  quickfix.c  $(SYMS)
 
 o/regexp.o:    regexp.c  $(SYMS) regexp.h
index 52b9e48336363ac40910b232389afac38421f64c..46c001575cddef4ffd92641fe29017e941a37174 100644 (file)
@@ -64,6 +64,7 @@ SRC = buffer.c \
        ops.c \
        option.c \
        os_amiga.c \
+       popupmenu.c \
        quickfix.c \
        regexp.c \
        screen.c \
@@ -109,6 +110,7 @@ OBJ =       obj/buffer.o \
        obj/ops.o \
        obj/option.o \
        obj/os_amiga.o \
+       obj/popupmenu.o \
        obj/quickfix.o \
        obj/regexp.o \
        obj/screen.o \
@@ -152,6 +154,7 @@ PRO =       proto/buffer.pro \
        proto/ops.pro \
        proto/option.pro \
        proto/os_amiga.pro \
+       proto/popupmenu.pro \
        proto/quickfix.pro \
        proto/regexp.pro \
        proto/screen.pro \
@@ -303,6 +306,9 @@ obj/option.o:       option.c
 obj/os_amiga.o:        os_amiga.c
        $(CCSYM) $@ os_amiga.c
 
+obj/popupmenu.o:       popupmenu.c
+       $(CCSYM) $@ popupmenu.c
+
 obj/quickfix.o:        quickfix.c
        $(CCSYM) $@ quickfix.c
 
index 9d78da56c178e08752d2e47cbc5bc97df057e1a6..7b601cc6815d6a876edd267538c5a2db93424337 100644 (file)
@@ -389,6 +389,7 @@ OBJ = \
        $(OUTDIR)/os_win32.o \
        $(OUTDIR)/os_mswin.o \
        $(OUTDIR)/pathdef.o \
+       $(OUTDIR)/popupmenu.o \
        $(OUTDIR)/quickfix.o \
        $(OUTDIR)/regexp.o \
        $(OUTDIR)/screen.o \
index 5be703a73ace246a9b928b19502ee8641c60182c..5955a60d9732d047ff426909d78709333443dd64 100644 (file)
@@ -52,6 +52,7 @@ SrcFiles      =  
                                  :src:option.c Â¶
                                  :src:os_mac.c Â¶
                                  :src:pty.c Â¶
+                                 :src:popupmenu.c Â¶
                                  :src:quickfix.c Â¶
                                  :src:regexp.c Â¶
                                  :src:screen.c Â¶
@@ -105,6 +106,7 @@ ObjFiles-PPC    =  
                                  "{ObjDir}option.c.x" Â¶
                                  "{ObjDir}os_mac.c.x" Â¶
                                  "{ObjDir}pty.c.x" Â¶
+                                 "{ObjDir}popupmenu.c.x" Â¶
                                  "{ObjDir}quickfix.c.x" Â¶
                                  "{ObjDir}regexp.c.x" Â¶
                                  "{ObjDir}screen.c.x" Â¶
@@ -189,6 +191,7 @@ VIm  
 "{ObjDir}option.c.x"  Ã„  :src:option.c
 "{ObjDir}os_mac.c.x"  Ã„  :src:os_mac.c
 "{ObjDir}pty.c.x"  Ã„  :src:pty.c
+"{ObjDir}popupmenu.c.x"  Ã„  :src:popupmenu.c
 "{ObjDir}quickfix.c.x"  Ã„  :src:quickfix.c
 "{ObjDir}regexp.c.x"  Ã„  :src:regexp.c
 "{ObjDir}screen.c.x"  Ã„  :src:screen.c
@@ -276,6 +279,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -359,6 +363,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -442,6 +447,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -525,6 +531,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -608,6 +615,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -692,6 +700,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -775,6 +784,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -858,6 +868,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -941,6 +952,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -1024,6 +1036,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -1107,6 +1120,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -1190,6 +1204,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -1273,6 +1288,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -1354,6 +1370,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -1437,6 +1454,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -1520,6 +1538,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -1603,6 +1622,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -1686,6 +1706,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -1795,6 +1816,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -1879,6 +1901,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -1962,6 +1985,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -2045,6 +2069,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -2128,6 +2153,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -2211,6 +2237,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -2294,6 +2321,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -2378,6 +2406,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -2461,6 +2490,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -2544,6 +2574,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -2627,6 +2658,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -2710,6 +2742,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -2793,6 +2826,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -2876,6 +2910,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -2959,6 +2994,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -3042,6 +3078,91 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
+       :src:proto:quickfix.pro Â¶
+       :src:proto:regexp.pro Â¶
+       :src:proto:screen.pro Â¶
+       :src:proto:search.pro Â¶
+       :src:proto:spell.pro Â¶
+       :src:proto:syntax.pro Â¶
+       :src:proto:tag.pro Â¶
+       :src:proto:term.pro Â¶
+       :src:proto:termlib.pro Â¶
+       :src:proto:ui.pro Â¶
+       :src:proto:undo.pro Â¶
+       :src:proto:version.pro Â¶
+       :src:proto:window.pro Â¶
+       :src:proto:if_python.pro Â¶
+       :src:proto:if_tcl.pro Â¶
+       :src:proto:if_ruby.pro Â¶
+       :src:proto:gui.pro Â¶
+       :src:proto:pty.pro Â¶
+       :src:proto:gui_gtk.pro Â¶
+       :src:proto:gui_gtk_x11.pro Â¶
+       :src:proto:gui_motif.pro Â¶
+       :src:proto:gui_athena.pro Â¶
+       :src:proto:gui_mac.pro Â¶
+       :src:proto:gui_x11.pro Â¶
+       :src:proto:workshop.pro Â¶
+       :src:proto:if_perl.pro Â¶
+       :src:proto:if_perlsfio.pro
+
+:obj:popupmenu.c.x     Ã„  Â¶
+       :src:popupmenu.c Â¶
+       :src:vim.h Â¶
+       :src:auto:config.h Â¶
+       :src:feature.h Â¶
+       :src:os_unix.h Â¶
+       :src:os_mac.h Â¶
+       :src:workshop.h Â¶
+       :src:ascii.h Â¶
+       :src:keymap.h Â¶
+       :src:term.h Â¶
+       :src:macros.h Â¶
+       :src:structs.h Â¶
+       :src:globals.h Â¶
+       :src:option.h Â¶
+       :src:ex_cmds.h Â¶
+       :src:proto.h Â¶
+       :src:integration.h Â¶
+       :src:wsdebug.h Â¶
+       :src:regexp.h Â¶
+       :src:gui.h Â¶
+       :src:farsi.h Â¶
+       :src:proto:os_unix.pro Â¶
+       :src:proto:os_mac.pro Â¶
+       :src:proto:buffer.pro Â¶
+       :src:proto:charset.pro Â¶
+       :src:proto:if_cscope.pro Â¶
+       :src:proto:diff.pro Â¶
+       :src:proto:digraph.pro Â¶
+       :src:proto:edit.pro Â¶
+       :src:proto:eval.pro Â¶
+       :src:proto:ex_cmds.pro Â¶
+       :src:proto:ex_cmds2.pro Â¶
+       :src:proto:ex_docmd.pro Â¶
+       :src:proto:ex_eval.pro Â¶
+       :src:proto:ex_getln.pro Â¶
+       :src:proto:fileio.pro Â¶
+       :src:proto:fold.pro Â¶
+       :src:proto:getchar.pro Â¶
+       :src:proto:hardcopy.pro Â¶
+       :src:proto:hashtable.pro Â¶
+       :src:proto:hangulin.pro Â¶
+       :src:proto:main.pro Â¶
+       :src:proto:mark.pro Â¶
+       :src:proto:memfile.pro Â¶
+       :src:proto:memline.pro Â¶
+       :src:proto:menu.pro Â¶
+       :src:proto:message.pro Â¶
+       :src:proto:misc1.pro Â¶
+       :src:proto:misc2.pro Â¶
+       :src:proto:move.pro Â¶
+       :src:proto:multibyte.pro Â¶
+       :src:proto:normal.pro Â¶
+       :src:proto:ops.pro Â¶
+       :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -3125,6 +3246,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -3208,6 +3330,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -3291,6 +3414,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -3374,6 +3498,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -3457,6 +3582,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -3540,6 +3666,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -3623,6 +3750,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -3706,6 +3834,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -3790,6 +3919,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -3872,6 +4002,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -3955,6 +4086,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -4039,6 +4171,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -4122,6 +4255,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
@@ -4205,6 +4339,7 @@ Dependencies  
        :src:proto:normal.pro Â¶
        :src:proto:ops.pro Â¶
        :src:proto:option.pro Â¶
+       :src:proto:popupmenu.pro Â¶
        :src:proto:quickfix.pro Â¶
        :src:proto:regexp.pro Â¶
        :src:proto:screen.pro Â¶
index 2c4cdaf9e0a3a4bf0dfde79aeeb9b56c1e3039c3..1a64c113d403be90c8535dbf77c766667eb45b15 100644 (file)
@@ -68,6 +68,7 @@ OBJ = \
        normal.o \
        ops.o \
        option.o \
+       popupmenu.o \
        quickfix.o \
        regexp.o \
        screen.o \
@@ -140,6 +141,7 @@ mbyte.o:    mbyte.c  $(INCL)
 normal.o:      normal.c  $(INCL)
 ops.o:         ops.c  $(INCL)
 option.o:      option.c  $(INCL)
+popupmenu.o:   popupmenu.c  $(INCL)
 quickfix.o:    quickfix.c  $(INCL)
 regexp.o:      regexp.c  $(INCL)
 screen.o:      screen.c  $(INCL)
index 38e6324b0312014edd83229c7875a8c36622376e..1577409a1f82bcd76b030839213568fdd3503af8 100644 (file)
@@ -15,7 +15,8 @@ OBJS =  o.buffer o.charset o.diff o.digraph o.edit o.eval o.ex_cmds o.ex_cmds2
        o.ex_docmd o.ex_eval o.ex_getln o.fileio o.fold o.getchar \
        o.hardcopy o.hashtable o.main o.mark o.mbyte  \
        o.memfile o.memline o.menu o.message o.misc1 o.misc2 o.move     \
-       o.normal o.ops o.option o.quickfix o.regexp o.screen o.search   \
+       o.normal o.ops o.option o.popupmenu o.quickfix o.regexp o.screen \
+       o.search   \
        o.spell o.syntax o.tag o.term o.termlib o.ui o.undo o.version   \
        o.window o.os_riscos o.swis o.gui o.gui_riscos
 
@@ -104,6 +105,8 @@ o.os_riscos:        c.os_riscos
 
 o.pty:         c.pty
 
+o.popupmenu:   c.popupmenu
+
 o.quickfix:    c.quickfix
 
 o.regexp:      c.regexp
index 484f562adffecfee0c659b5ce7d99adc2a2b4649..9caadd0494093fb79461937b1692b903389d2111 100644 (file)
@@ -119,6 +119,7 @@ SRC = \
        ops.c \
        option.c \
        os_amiga.c \
+       popupmenu.c \
        quickfix.c \
        regexp.c \
        screen.c \
@@ -163,6 +164,7 @@ OBJ = \
        ops.o \
        option.o \
        os_amiga.o \
+       popupmenu.o \
        quickfix.o \
        regexp.o \
        screen.o \
@@ -207,6 +209,7 @@ PRO = \
        proto/ops.pro \
        proto/option.pro \
        proto/os_amiga.pro \
+       proto/popupmenu.pro \
        proto/quickfix.pro \
        proto/regexp.pro \
        proto/screen.pro \
@@ -335,6 +338,8 @@ option.o:           option.c
 proto/option.pro:      option.c
 os_amiga.o:            os_amiga.c
 proto/os_amiga.pro:    os_amiga.c
+popupmenu.o:           popupmenu.c
+proto/popupmenu.pro:   popupmenu.c
 quickfix.o:            quickfix.c
 proto/quickfix.pro:    quickfix.c
 regexp.o:              regexp.c
index 42d15470a5ebe43911b9b474ff2f349bc3973d36..598d72e6e436c9dec09227429a231e5172b34d04 100644 (file)
@@ -107,6 +107,7 @@ ObjFiles = \
    $(INTDIR)\os_win16.obj\
    $(INTDIR)\os_msdos.obj\
    $(INTDIR)\os_mswin.obj\
+   $(INTDIR)\popupmenu.obj\
    $(INTDIR)\quickfix.obj\
    $(INTDIR)\regexp.obj\
    $(INTDIR)\screen.obj\
index 0340f796bd6f266a24ce6ad842d2252e8fee8a7b..92ccafbdacbbd9b8819e825d9e40c86b0d7f633a 100644 (file)
@@ -1371,6 +1371,7 @@ BASIC_SRC = \
        option.c \
        os_unix.c \
        auto/pathdef.c \
+       popupmenu.c \
        quickfix.c \
        regexp.c \
        screen.c \
@@ -1441,6 +1442,7 @@ OBJ = \
        objects/option.o \
        objects/os_unix.o \
        objects/pathdef.o \
+       objects/popupmenu.o \
        objects/quickfix.o \
        objects/regexp.o \
        objects/screen.o \
@@ -1500,6 +1502,7 @@ PRO_AUTO = \
        ops.pro \
        option.pro \
        os_unix.pro \
+       popupmenu.pro \
        quickfix.pro \
        regexp.pro \
        screen.pro \
@@ -1611,14 +1614,19 @@ xxd/xxd$(EXEEXT): xxd/xxd.c
 # Generate the converted .mo files separately, it's no problem if this fails.
 languages:
        @if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \
+               $(MAKE) language-check; \
                cd $(PODIR); \
-               CC="$(CC)" $(MAKE) check; \
                CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix); \
        fi
        -@if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \
                cd $(PODIR); CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix) converted; \
        fi
 
+# Separate target to check the po files for valitidy, because it depends on
+# ./vim.
+language-check: $(VIMTARGET)
+       cd $(PODIR); $(MAKE) check VIM=../$(VIMTARGET)
+
 # Update the *.po files for changes in the sources.  Only run manually.
 update-po:
        cd $(PODIR); CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix) update-po
@@ -2457,6 +2465,9 @@ objects/py_getpath.o: $(PYTHON_CONFDIR)/getpath.c
 objects/pty.o: pty.c
        $(CCC) -o $@ pty.c
 
+objects/popupmenu.o: popupmenu.c
+       $(CCC) -o $@ popupmenu.c
+
 objects/quickfix.o: quickfix.c
        $(CCC) -o $@ quickfix.c
 
index e4370fcc2912940981286ff125092699f16a44e7..140c17f75765ce29a50321577632a7fe2dd810fb 100644 (file)
@@ -109,10 +109,14 @@ static void ins_ctrl_x __ARGS((void));
 static int  has_compl_option __ARGS((int dict_opt));
 static void ins_compl_add_matches __ARGS((int num_matches, char_u **matches, int dir));
 static int  ins_compl_make_cyclic __ARGS((void));
+static void ins_compl_upd_pum __ARGS((void));
+static void ins_compl_del_pum __ARGS((void));
+static int pum_wanted __ARGS((void));
+static void ins_compl_show_pum __ARGS((void));
 static void ins_compl_dictionaries __ARGS((char_u *dict, char_u *pat, int dir, int flags, int thesaurus));
 static void ins_compl_free __ARGS((void));
 static void ins_compl_clear __ARGS((void));
-static void ins_compl_prep __ARGS((int c));
+static int  ins_compl_prep __ARGS((int c));
 static buf_T *ins_compl_next_buf __ARGS((buf_T *buf, int flag));
 static int  ins_compl_get_exp __ARGS((pos_T *ini, int dir));
 static void ins_compl_delete __ARGS((void));
@@ -659,10 +663,19 @@ edit(cmdchar, startln, count)
 #endif
 
 #ifdef FEAT_INS_EXPAND
+       /* When the popup menu is visible cursor keys change the selection. */
+       if (c == K_UP && pum_visible())
+           c = Ctrl_P;
+       if (c == K_DOWN && pum_visible())
+           c = Ctrl_N;
+
        /* Prepare for or stop CTRL-X mode.  This doesn't do completion, but
         * it does fix up the text when finishing completion. */
        if (c != K_IGNORE)
-           ins_compl_prep(c);
+       {
+           if (ins_compl_prep(c))
+               continue;
+       }
 #endif
 
        /* CTRL-\ CTRL-N goes to Normal mode,
@@ -1968,6 +1981,9 @@ ins_compl_add(str, len, fname, dir, flags)
        } while (match != NULL && match != compl_first_match);
     }
 
+    /* Remove any popup menu before changing the list of matches. */
+    ins_compl_del_pum();
+
     /*
      * Allocate a new match structure.
      * Copy the values to the new match structure.
@@ -2073,6 +2089,157 @@ ins_compl_make_cyclic()
     return count;
 }
 
+static char_u **compl_match_array = NULL;
+static int compl_match_arraysize;
+
+/*
+ * Update the screen and when there is any scrolling remove the popup menu.
+ */
+    static void
+ins_compl_upd_pum()
+{
+    int                h;
+
+    if (compl_match_array != NULL)
+    {
+       h = curwin->w_cline_height;
+       update_screen(0);
+       if (h != curwin->w_cline_height)
+           ins_compl_del_pum();
+    }
+}
+
+/*
+ * Remove any popup menu.
+ */
+    static void
+ins_compl_del_pum()
+{
+    if (compl_match_array != NULL)
+    {
+       pum_undisplay();
+       vim_free(compl_match_array);
+       compl_match_array = NULL;
+    }
+}
+
+/*
+ * Return TRUE if the popup menu should be displayed.
+ */
+    static int
+pum_wanted()
+{
+    compl_T     *compl;
+    int                i;
+
+    /* 'completeopt' must contain "menu" */
+    if (*p_cot == NUL)
+       return FALSE;
+
+    /* The display looks bad on a B&W display. */
+    if (t_colors < 8
+#ifdef FEAT_GUI
+           && !gui.in_use
+#endif
+           )
+       return FALSE;
+
+    /* Don't display the popup menu if there are no matches or there is only
+     * one (ignoring the original text). */
+    compl = compl_first_match;
+    i = 0;
+    do
+    {
+       if (compl == NULL
+                     || ((compl->cp_flags & ORIGINAL_TEXT) == 0 && ++i == 2))
+           break;
+       compl = compl->cp_next;
+    } while (compl != compl_first_match);
+
+    return (i >= 2);
+}
+
+/*
+ * Show the popup menu for the list of matches.
+ */
+    static void
+ins_compl_show_pum()
+{
+    compl_T     *compl;
+    int                i;
+    int                cur = -1;
+    colnr_T    col;
+
+    if (!pum_wanted())
+       return;
+
+    /* Update the screen before drawing the popup menu over it. */
+    update_screen(0);
+
+    if (compl_match_array == NULL)
+    {
+       /* Need to build the popup menu list. */
+       compl_match_arraysize = 0;
+       compl = compl_first_match;
+       do
+       {
+           if ((compl->cp_flags & ORIGINAL_TEXT) == 0)
+               ++compl_match_arraysize;
+           compl = compl->cp_next;
+       } while (compl != NULL && compl != compl_first_match);
+       compl_match_array = (char_u **)alloc((unsigned)(sizeof(char_u **)
+                                                   * compl_match_arraysize));
+       if (compl_match_array != NULL)
+       {
+           i = 0;
+           compl = compl_first_match;
+           do
+           {
+               if ((compl->cp_flags & ORIGINAL_TEXT) == 0)
+               {
+                   if (compl == compl_shown_match)
+                       cur = i;
+                   compl_match_array[i++] = compl->cp_str;
+               }
+               compl = compl->cp_next;
+           } while (compl != NULL && compl != compl_first_match);
+       }
+    }
+    else
+    {
+       /* popup menu already exists, only need to find the current item.*/
+       i = 0;
+       compl = compl_first_match;
+       do
+       {
+           if ((compl->cp_flags & ORIGINAL_TEXT) == 0)
+           {
+               if (compl == compl_shown_match)
+               {
+                   cur = i;
+                   break;
+               }
+               ++i;
+           }
+           compl = compl->cp_next;
+       } while (compl != NULL && compl != compl_first_match);
+    }
+
+    if (compl_match_array != NULL)
+    {
+       /* Compute the screen column of the start of the completed text.
+        * Use the cursor to get all wrapping and other settings right. */
+       col = curwin->w_cursor.col;
+       curwin->w_cursor.col = compl_col;
+       validate_cursor_col();
+       pum_display(compl_match_array, compl_match_arraysize, cur,
+                 curwin->w_cline_row + W_WINROW(curwin),
+                 curwin->w_cline_height,
+                 curwin->w_wcol + W_WINCOL(curwin));
+       curwin->w_cursor.col = col;
+    }
+}
+
 #define DICT_FIRST     (1)     /* use just first element in "dict" */
 #define DICT_EXACT     (2)     /* "dict" is the exact name of a file */
 /*
@@ -2277,6 +2444,10 @@ ins_compl_free()
 
     if (compl_first_match == NULL)
        return;
+
+    ins_compl_del_pum();
+    pum_clear();
+
     compl_curr_match = compl_first_match;
     do
     {
@@ -2306,14 +2477,16 @@ ins_compl_clear()
 /*
  * Prepare for Insert mode completion, or stop it.
  * Called just after typing a character in Insert mode.
+ * Returns TRUE when the character is not to be inserted;
  */
-    static void
+    static int
 ins_compl_prep(c)
     int            c;
 {
     char_u     *ptr;
     int                temp;
     int                want_cindent;
+    int                retval = FALSE;
 
     /* Forget any previous 'special' messages if this is actually
      * a ^X mode key - bar ^R, in which case we wait to see what it gives us.
@@ -2323,7 +2496,7 @@ ins_compl_prep(c)
 
     /* Ignore end of Select mode mapping */
     if (c == K_SELECT)
-       return;
+       return retval;
 
     if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET)
     {
@@ -2504,6 +2677,11 @@ ins_compl_prep(c)
 
            auto_format(FALSE, TRUE);
 
+           /* if the popup menu is displayed hitting Enter means accepting
+            * the selection without inserting anything. */
+           if ((c == CAR || c == K_KENTER || c == NL) && pum_visible())
+               retval = TRUE;
+
            ins_compl_free();
            compl_started = FALSE;
            compl_matches = 0;
@@ -2534,6 +2712,8 @@ ins_compl_prep(c)
        compl_cont_status = 0;
        compl_cont_mode = 0;
     }
+
+    return retval;
 }
 
 /*
@@ -2890,8 +3070,8 @@ ins_compl_get_exp(ini, dir)
            {
                int     flags = 0;
 
-               /* ctrl_x_mode == CTRL_X_WHOLE_LINE || word-wise search that has
-                * added a word that was at the beginning of the line */
+               /* ctrl_x_mode == CTRL_X_WHOLE_LINE || word-wise search that
+                * has added a word that was at the beginning of the line */
                if (    ctrl_x_mode == CTRL_X_WHOLE_LINE
                        || (compl_cont_status & CONT_SOL))
                    found_new_match = search_for_exact_line(ins_buf, pos,
@@ -2999,7 +3179,7 @@ ins_compl_get_exp(ini, dir)
                    }
                }
                if (ins_compl_add_infercase(ptr, len,
-                           ins_buf == curbuf ?  NULL : ins_buf->b_sfname,
+                                ins_buf == curbuf ? NULL : ins_buf->b_sfname,
                                                       dir, flags) != NOTDONE)
                {
                    found_new_match = OK;
@@ -3009,22 +3189,35 @@ ins_compl_get_exp(ini, dir)
            p_scs = save_p_scs;
            p_ws = save_p_ws;
        }
+
        /* check if compl_curr_match has changed, (e.g. other type of
         * expansion added somenthing) */
-       if (compl_curr_match != old_match)
+       if (type != 0 && compl_curr_match != old_match)
            found_new_match = OK;
 
        /* break the loop for specialized modes (use 'complete' just for the
         * generic ctrl_x_mode == 0) or when we've found a new match */
        if ((ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE)
                                                   || found_new_match != FAIL)
-           break;
-
-       /* Mark a buffer scanned when it has been scanned completely */
-       if (type == 0 || type == CTRL_X_PATH_PATTERNS)
-           ins_buf->b_scanned = TRUE;
+       {
+           if (got_int)
+               break;
+           if (pum_wanted() && type != -1)
+               /* Fill the popup menu as soon as possible. */
+               ins_compl_check_keys(0);
+           if ((ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE)
+                                                        || compl_interrupted)
+               break;
+           compl_started = TRUE;
+       }
+       else
+       {
+           /* Mark a buffer scanned when it has been scanned completely */
+           if (type == 0 || type == CTRL_X_PATH_PATTERNS)
+               ins_buf->b_scanned = TRUE;
 
-       compl_started = FALSE;
+           compl_started = FALSE;
+       }
     }
     compl_started = TRUE;
 
@@ -3106,8 +3299,7 @@ ins_compl_next(allow_get_expansion)
        compl_pending = TRUE;
        if (allow_get_expansion)
        {
-           num_matches = ins_compl_get_exp(&compl_startpos,
-                                                         compl_direction);
+           num_matches = ins_compl_get_exp(&compl_startpos, compl_direction);
            if (compl_pending)
            {
                if (compl_direction == compl_shows_dir)
@@ -3123,9 +3315,15 @@ ins_compl_next(allow_get_expansion)
 
     if (!allow_get_expansion)
     {
+       /* may undisplay the popup menu first */
+       ins_compl_upd_pum();
+
        /* Display the current match. */
        update_screen(0);
 
+       /* display the updated popup menu */
+       ins_compl_show_pum();
+
        /* Delete old text to be replaced, since we're still searching and
         * don't want to match ourselves!  */
        ins_compl_delete();
@@ -3593,6 +3791,9 @@ ins_complete(c)
      */
     n = ins_compl_next(TRUE);
 
+    /* may undisplay the popup menu */
+    ins_compl_upd_pum();
+
     if (n > 1)         /* all matches have been found */
        compl_matches = n;
     compl_curr_match = compl_shown_match;
@@ -3671,8 +3872,8 @@ ins_complete(c)
                    if (match != NULL)
                        /* go up and assign all numbers which are not assigned
                         * yet */
-                       for (match = match->cp_next; match
-                               && match->cp_number == -1;
+                       for (match = match->cp_next;
+                               match != NULL && match->cp_number == -1;
                                                       match = match->cp_next)
                            match->cp_number = ++number;
                }
@@ -3699,8 +3900,8 @@ ins_complete(c)
                }
            }
 
-           /* The match should always have a sequnce number now, this is just
-            * a safety check. */
+           /* The match should always have a sequence number now, this is
+            * just a safety check. */
            if (compl_curr_match->cp_number != -1)
            {
                /* Space for 10 text chars. + 2x10-digit no.s */
@@ -3733,6 +3934,8 @@ ins_complete(c)
     else
        msg_clr_cmdline();      /* necessary for "noshowmode" */
 
+    ins_compl_show_pum();
+
     return OK;
 }
 
index 2748915be4f57b3de932643619a7475f77b5bc2a..f92140adb49233960f82d797232ee8a7c2825559 100644 (file)
@@ -1289,7 +1289,7 @@ getcmdline(firstc, count, indent)
                goto cmdline_not_changed;
 
        case K_VER_SCROLLBAR:
-               if (!msg_scrolled)
+               if (msg_scrolled == 0)
                {
                    gui_do_scroll();
                    redrawcmd();
@@ -1297,7 +1297,7 @@ getcmdline(firstc, count, indent)
                goto cmdline_not_changed;
 
        case K_HOR_SCROLLBAR:
-               if (!msg_scrolled)
+               if (msg_scrolled == 0)
                {
                    gui_do_horiz_scroll();
                    redrawcmd();
@@ -2897,7 +2897,7 @@ redrawcmd()
     void
 compute_cmdrow()
 {
-    if (exmode_active || msg_scrolled)
+    if (exmode_active || msg_scrolled != 0)
        cmdline_row = Rows - 1;
     else
        cmdline_row = W_WINROW(lastwin) + lastwin->w_height
index e74306196b4b468120287e060b7344ac3c51af03..f00e1ea75e38233c355ba7870576459d151e5dde 100644 (file)
@@ -2193,7 +2193,7 @@ failed:
 #endif
                p = msg_trunc_attr(IObuff, FALSE, 0);
            if (read_stdin || read_buffer || restart_edit != 0
-                   || (msg_scrolled && !need_wait_return))
+                   || (msg_scrolled != 0 && !need_wait_return))
            {
                /* Need to repeat the message after redrawing when:
                 * - When reading from stdin (the screen will be cleared next).
index 9135992cc030f2b879d8fee6725c63e4946f27ca..9561195dc40c1e7096cec8be569c6a336b699382 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -3492,7 +3492,7 @@ gui_drag_scrollbar(sb, value, still_dragging)
            ins_horscroll();
        else if (State & CMDLINE)
        {
-           if (!msg_scrolled)
+           if (msg_scrolled == 0)
            {
                gui_do_horiz_scroll();
                redrawcmdline();
index b3c80d6a4f1e81050dffc4abdf989138dc40b2ae..4d7a95b1e71f7a1f4380f02d794ad64885b5f726 100644 (file)
@@ -657,6 +657,15 @@ static struct vimoption
 #else
                            (char_u *)NULL, PV_NONE,
                            {(char_u *)0L, (char_u *)0L}
+#endif
+                           },
+    {"completeopt",   "cot",  P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
+#ifdef FEAT_INS_EXPAND
+                           (char_u *)&p_cot, PV_NONE,
+                           {(char_u *)"menu", (char_u *)0L}
+#else
+                           (char_u *)NULL, PV_NONE,
+                           {(char_u *)0L, (char_u *)0L}
 #endif
                            },
     {"confirm",     "cf",   P_BOOL|P_VI_DEF,
@@ -1119,7 +1128,7 @@ static struct vimoption
                            {(char_u *)FALSE, (char_u *)0L}},
     {"highlight",   "hl",   P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP,
                            (char_u *)&p_hl, PV_NONE,
-                           {(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal",
+                           {(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb",
                                (char_u *)0L}},
     {"history",            "hi",   P_NUM|P_VIM,
                            (char_u *)&p_hi, PV_NONE,
@@ -2608,12 +2617,15 @@ static char *(p_bufhidden_values[]) = {"hide", "unload", "delete", "wipe", NULL}
 static char *(p_bs_values[]) = {"indent", "eol", "start", NULL};
 #ifdef FEAT_FOLDING
 static char *(p_fdm_values[]) = {"manual", "expr", "marker", "indent", "syntax",
-#ifdef FEAT_DIFF
+# ifdef FEAT_DIFF
                                "diff",
-#endif
+# endif
                                NULL};
 static char *(p_fcl_values[]) = {"all", NULL};
 #endif
+#ifdef FEAT_INS_EXPAND
+static char *(p_cot_values[]) = {"menu", NULL};
+#endif
 
 static void set_option_default __ARGS((int, int opt_flags, int compatible));
 static void set_options_default __ARGS((int opt_flags));
@@ -5930,6 +5942,13 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
            }
        }
     }
+
+    /* 'completeopt' */
+    else if (varp == &p_cot)
+    {
+       if (check_opt_strings(p_cot, p_cot_values, TRUE) != OK)
+           errmsg = e_invarg;
+    }
 #endif /* FEAT_INS_EXPAND */
 
 
index 3cfdd4fbaba431f5de171420c85a451d12993ea4..173919eda65735adb08bbaa74a4ab3671ff71992 100644 (file)
@@ -384,6 +384,9 @@ EXTERN long p_ch;           /* 'cmdheight' */
 EXTERN int     p_confirm;      /* 'confirm' */
 #endif
 EXTERN int     p_cp;           /* 'compatible' */
+#ifdef FEAT_INS_EXPAND
+EXTERN char_u  *p_cot;         /* 'completeopt' */
+#endif
 EXTERN char_u  *p_cpo;         /* 'cpoptions' */
 #ifdef FEAT_CSCOPE
 EXTERN char_u  *p_csprg;       /* 'cscopeprg' */
index fa1390424962fb5042ad44ba0ea31a1fcc26c9b8..1a2161f96144b548228de907b3c28c2846f221e7 100644 (file)
@@ -5296,7 +5296,13 @@ win_redr_status(wp)
        /* no status line, can only be last window */
        redraw_cmdline = TRUE;
     }
-    else if (!redrawing())
+    else if (!redrawing()
+#ifdef FEAT_INS_EXPAND
+           /* don't update status line when popup menu is visible and may be
+            * drawn over it */
+           || pum_visible()
+#endif
+           )
     {
        /* Don't redraw right now, do it later. */
        wp->w_redr_status = TRUE;
@@ -8534,6 +8540,9 @@ win_redr_ruler(wp, always)
 # endif
        if (edit_submode != NULL)
            return;
+    /* Don't draw the ruler when the popup menu is visible, it may overlap. */
+    if (pum_visible())
+       return;
 #endif
 
 #ifdef FEAT_STL_OPT
index a04b81b34f0d1b0c9175aa9a653831d00bc686ab..ce2ff88521bf6410f16a01f82f02bd8c4006d166 100644 (file)
@@ -6065,6 +6065,8 @@ static char *(highlight_init_both[]) =
        "VertSplit term=reverse cterm=reverse gui=reverse",
        "VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold",
        "DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red",
+       "PmenuThumb cterm=reverse gui=reverse",
+       "PmenuSbar ctermbg=Grey guibg=Grey",
        NULL
     };
 
@@ -6080,6 +6082,8 @@ static char *(highlight_init_light[]) =
        "SpellCap term=reverse ctermbg=LightBlue guisp=Blue gui=undercurl",
        "SpellRare term=reverse ctermbg=LightMagenta guisp=Magenta gui=undercurl",
        "SpellLocal term=underline ctermbg=Cyan guisp=DarkCyan gui=undercurl",
+       "Pmenu ctermbg=LightMagenta guibg=LightMagenta",
+       "PmenuSel ctermbg=LightGrey guibg=Grey",
        "SpecialKey term=bold ctermfg=DarkBlue guifg=Blue",
        "Title term=bold ctermfg=DarkMagenta gui=bold guifg=Magenta",
        "WarningMsg term=standout ctermfg=DarkRed guifg=Red",
@@ -6107,6 +6111,8 @@ static char *(highlight_init_dark[]) =
        "SpellCap term=reverse ctermbg=Blue guisp=Blue gui=undercurl",
        "SpellRare term=reverse ctermbg=Magenta guisp=Magenta gui=undercurl",
        "SpellLocal term=underline ctermbg=Cyan guisp=Cyan gui=undercurl",
+       "Pmenu ctermbg=Magenta guibg=Magenta",
+       "PmenuSel ctermbg=Grey guibg=Grey",
        "Title term=bold ctermfg=LightMagenta gui=bold guifg=Magenta",
        "WarningMsg term=standout ctermfg=LightRed guifg=Red",
        "WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black",
index 0d54051846b91017a1740994e87716126b4b49ff..85d76ae40d2378b671963d7984b9284b59b4c759 100644 (file)
@@ -23,10 +23,12 @@ Test for insert expansion
 STARTTEST
 :so small.vim
 :se nocp viminfo+=nviminfo cpt=.,w ff=unix | $-2,$w!Xtestfile | set ff&
+:se cot=
 \17nO#include "Xtestfile"
 ru\ e\ e\18\ e\e\ 1
 O\10\18\ e
 \18\10\10\10\10\10
+
 \18\10\10\18\18\ e\18\ e\ e\e
 :se cpt=.,w,i
 kOM\ e\18\ e\18\ e\18\18\18\10
index 85bf690b557c478af8089462d655749e8c634aba..3571032cef4244368b8d7815f4a1e99cac2d2aec 100644 (file)
@@ -36,5 +36,5 @@
 #define VIM_VERSION_NODOT      "vim70aa"
 #define VIM_VERSION_SHORT      "7.0aa"
 #define VIM_VERSION_MEDIUM     "7.0aa ALPHA"
-#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 30)"
-#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 30, compiled "
+#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2005 Oct 3)"
+#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2005 Oct 3, compiled "