]> granicus.if.org Git - vim/commitdiff
updated for version 7.0194 v7.0194
authorBram Moolenaar <Bram@vim.org>
Wed, 8 Feb 2006 09:20:24 +0000 (09:20 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 8 Feb 2006 09:20:24 +0000 (09:20 +0000)
31 files changed:
runtime/autoload/ccomplete.vim
runtime/autoload/htmlcomplete.vim
runtime/autoload/javascriptcomplete.vim
runtime/autoload/xmlcomplete.vim
runtime/doc/index.txt
runtime/doc/insert.txt
runtime/doc/netbeans.txt
runtime/doc/tags
runtime/doc/todo.txt
runtime/doc/various.txt
runtime/doc/version7.txt
runtime/ftplugin/lprolog.vim
runtime/ftplugin/ocaml.vim
runtime/syntax/dot.vim
runtime/syntax/lprolog.vim
runtime/syntax/sh.vim
runtime/syntax/sml.vim
runtime/syntax/vim.vim
src/Make_mvc.mak
src/edit.c
src/eval.c
src/ex_cmds.h
src/netbeans.c
src/popupmenu.c
src/proto/edit.pro
src/proto/eval.pro
src/proto/popupmenu.pro
src/proto/quickfix.pro
src/quickfix.c
src/structs.h
src/version.h

index 5e0c2aea352055adcc5dd78442106e9bb4ed5631..7a840b12e5da998d1b302885c915a4f9983e42cf 100644 (file)
@@ -1,7 +1,7 @@
 " Vim completion script
 " Language:    C
 " Maintainer:  Bram Moolenaar <Bram@vim.org>
-" Last Change: 2006 Feb 03
+" Last Change: 2006 Feb 06
 
 
 " This function is used for the 'omnifunc' option.
@@ -213,22 +213,29 @@ endfunction
 " If it is a variable we may add "." or "->".  Don't do it for other types,
 " such as a typedef, by not including the info that s:GetAddition() uses.
 function! s:Tag2item(val)
+  let x = substitute(a:val['cmd'], '^/^', '', '')
+  let x = substitute(x, '$/$', '', '')
+  let x = substitute(x, a:val['name'], '@@', '')
   if has_key(a:val, "kind")
     if a:val["kind"] == 'v'
-      return {'match': a:val['name'], 'tagline': "\t" . a:val['cmd'], 'dict': a:val}
+      return {'match': a:val['name'], 'tagline': "\t" . a:val['cmd'], 'dict': a:val, 'extra': x}
     endif
     if a:val["kind"] == 'f'
-      return {'match': a:val['name'] . '(', 'tagline': ""}
+      return {'match': a:val['name'] . '(', 'tagline': "", 'extra': x}
     endif
   endif
-  return {'match': a:val['name'], 'tagline': ''}
+  return {'match': a:val['name'], 'tagline': '', 'extra': x}
 endfunction
 
 " Turn a match item "val" into an item for completion.
 " "val['match']" is the matching item.
 " "val['tagline']" is the tagline in which the last part was found.
 function! s:Tagline2item(val, brackets)
-  return a:val['match'] . a:brackets . s:GetAddition(a:val['tagline'], a:val['match'], [a:val], a:brackets == '')
+  let word = a:val['match'] . a:brackets . s:GetAddition(a:val['tagline'], a:val['match'], [a:val], a:brackets == '')
+  if has_key(a:val, 'extra')
+    return {'word': word, 'menu': a:val['extra']}
+  endif
+  return {'word': word, 'menu': substitute(a:val['tagline'], word, '@@', '')}
 endfunction
 
 
index cf76e69cc84ee2e5a3c5f2972f145cb00e90928b..a6295373ed7c6ffd24fc0f3f33656b293834c317 100644 (file)
@@ -1,7 +1,7 @@
 " Vim completion script
 " Language:    XHTML 1.0 Strict
 " Maintainer:  Mikolaj Machowski ( mikmach AT wp DOT pl )
-" Last Change: 2006 Jan 30
+" Last Change: 2006 Feb 6
 
 function! htmlcomplete#CompleteTags(findstart, base)
   if a:findstart
@@ -13,11 +13,14 @@ function! htmlcomplete#CompleteTags(findstart, base)
     while start >= 0 && line[start - 1] =~ '\(\k\|[:.-]\)'
                let start -= 1
     endwhile
+       " Handling of entities {{{
        if start >= 0 && line[start - 1] =~ '&'
                let b:entitiescompl = 1
                let b:compl_context = ''
                return start
        endif
+       " }}}
+       " Handling of <style> tag {{{
        let stylestart = searchpair('<style\>', '', '<\/style\>', "bnW")
        let styleend   = searchpair('<style\>', '', '<\/style\>', "nW")
        if stylestart != 0 && styleend != 0 
@@ -29,6 +32,8 @@ function! htmlcomplete#CompleteTags(findstart, base)
                        endwhile
                endif
        endif
+       " }}}
+       " Handling of <script> tag {{{
        let scriptstart = searchpair('<script\>', '', '<\/script\>', "bnW")
        let scriptend   = searchpair('<script\>', '', '<\/script\>', "nW")
        if scriptstart != 0 && scriptend != 0 
@@ -36,16 +41,44 @@ function! htmlcomplete#CompleteTags(findstart, base)
                        let start = col('.') - 1
                        let b:jscompl = 1
                        let b:jsrange = [scriptstart, scriptend]
-                       while start >= 0 && line[start - 1] =~ '\(\k\|-\)'
+                       while start >= 0 && line[start - 1] =~ '\w'
                                let start -= 1
                        endwhile
+                       " We are inside of <script> tag. But we should also get contents
+                       " of all linked external files and (secondary, less probably) other <script> tags
+                       " This logic could possible be done in separate function - may be
+                       " reused in events scripting (also with option could be reused for
+                       " CSS
+                       let b:js_extfiles = []
+                       let l = line('.')
+                       let c = col('.')
+                       call cursor(1,1)
+                       while search('<\@<=script\>', 'W') && line('.') <= l
+                               if synIDattr(synID(line('.'),col('.')-1,0),"name") !~? 'comment'
+                                       let sname = matchstr(getline('.'), '<script[^>]*src\s*=\s*\([''"]\)\zs.\{-}\ze\1')
+                                       if filereadable(sname)
+                                               let b:js_extfiles += readfile(sname)
+                                       endif
+                               endif
+                       endwhile
+                       call cursor(1,1)
+                       let js_scripttags = []
+                       while search('<script\>', 'W') && line('.') < l
+                               if matchstr(getline('.'), '<script[^>]*src') == ''
+                                       let js_scripttag = getline(line('.'), search('</script>', 'W'))
+                                       let js_scripttags += js_scripttag
+                               endif
+                       endwhile
+                       let b:js_extfiles += js_scripttags
+                       call cursor(l,c)
+                       unlet! l c
                endif
        endif
+       " }}}
        if !exists("b:csscompl") && !exists("b:jscompl")
                let b:compl_context = getline('.')[0:(compl_begin)]
                if b:compl_context !~ '<[^>]*$'
-                       " Look like we may have broken tag. Check previous lines. Up to
-                       " 10?
+                       " Look like we may have broken tag. Check previous lines.
                        let i = 1
                        while 1
                                let context_line = getline(curline-i)
@@ -65,6 +98,14 @@ function! htmlcomplete#CompleteTags(findstart, base)
                        unlet! i
                endif
                let b:compl_context = matchstr(b:compl_context, '.*\zs<.*')
+               " Return proper start for on-events. Without that beginning of
+               " completion will be badly reported
+               if b:compl_context =~? 'on[a-z]*\s*=\s*\(''[^'']*\|"[^"]*\)$'
+                       let start = col('.') - 1
+                       while start >= 0 && line[start - 1] =~ '\w'
+                               let start -= 1
+                       endwhile
+               endif
        else
                let b:compl_context = getline('.')[0:compl_begin]
        endif
@@ -76,14 +117,15 @@ function! htmlcomplete#CompleteTags(findstart, base)
        " a:base is very short - we need context
        let context = b:compl_context
        " Check if we should do CSS completion inside of <style> tag
+       " or JS completion inside of <script> tag
        if exists("b:csscompl")
                unlet! b:csscompl
                let context = b:compl_context
+               unlet! b:compl_context
                return csscomplete#CompleteCSS(0, context)
        elseif exists("b:jscompl")
                unlet! b:jscompl
-               let context = b:compl_context
-               return javascriptcomplete#CompleteJS(0, context)
+               return javascriptcomplete#CompleteJS(0, a:base)
        else
                if len(b:compl_context) == 0 && !exists("b:entitiescompl")
                        return []
@@ -91,7 +133,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
                let context = matchstr(b:compl_context, '.\zs.*')
        endif
        unlet! b:compl_context
-       " Make entities completion
+       " Entities completion {{{
        if exists("b:entitiescompl")
                unlet! b:entitiescompl
 
@@ -122,6 +164,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
 
 
        endif
+       " }}}
        if context =~ '>'
                " Generally if context contains > it means we are outside of tag and
                " should abandon action - with one exception: <style> span { bo
@@ -142,13 +185,11 @@ function! htmlcomplete#CompleteTags(findstart, base)
                        \ "onmouseover", "onmouseout", "onkeypress", "onkeydown", "onkeyup"]
     let focus = ["accesskey", "tabindex", "onfocus", "onblur"]
     let coregroup = coreattrs + i18n + events
-    " find tags matching with "context"
        " If context contains > it means we are already outside of tag and we
        " should abandon action
        " If context contains white space it is attribute. 
-       " It could be also value of attribute...
-       " We have to get first word to offer
-       " proper completions
+       " It can be also value of attribute.
+       " We have to get first word to offer proper completions
        if context == ''
                let tag = ''
        else
@@ -160,11 +201,12 @@ function! htmlcomplete#CompleteTags(findstart, base)
        " 1. Events attributes
        if context =~ '\s'
                " Sort out style, class, and on* cases
-               if context =~ "\\(on[a-z]*\\|id\\|style\\|class\\)\\s*=\\s*[\"']"
-                       if context =~ "\\(id\\|class\\)\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
-                               if context =~ "class\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
+               if context =~? "\\(on[a-z]*\\|id\\|style\\|class\\)\\s*=\\s*[\"']"
+                       " Id, class completion {{{
+                       if context =~? "\\(id\\|class\\)\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
+                               if context =~? "class\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
                                        let search_for = "class"
-                               elseif context =~ "id\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
+                               elseif context =~? "id\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
                                        let search_for = "id"
                                endif
                                " Handle class name completion
@@ -327,17 +369,59 @@ function! htmlcomplete#CompleteTags(findstart, base)
 
                                return res + res2
 
-                       elseif context =~ "style\\s*=\\s*[\"'][^\"']*$"
+                       elseif context =~? "style\\s*=\\s*[\"'][^\"']*$"
                                return csscomplete#CompleteCSS(0, context)
 
                        endif
-                       let stripbase = matchstr(context, ".*\\(on[a-z]*\\|style\\|class\\)\\s*=\\s*[\"']\\zs.*")
+                       " }}}
+                       " Complete on-events {{{
+                       if context =~? 'on[a-z]*\s*=\s*\(''[^'']*\|"[^"]*\)$'
+                               " We have to:
+                               " 1. Find external files
+                               let b:js_extfiles = []
+                               let l = line('.')
+                               let c = col('.')
+                               call cursor(1,1)
+                               while search('<\@<=script\>', 'W') && line('.') <= l
+                                       if synIDattr(synID(line('.'),col('.')-1,0),"name") !~? 'comment'
+                                               let sname = matchstr(getline('.'), '<script[^>]*src\s*=\s*\([''"]\)\zs.\{-}\ze\1')
+                                               if filereadable(sname)
+                                                       let b:js_extfiles += readfile(sname)
+                                               endif
+                                       endif
+                               endwhile
+                               " 2. Find at least one <script> tag
+                               call cursor(1,1)
+                               let js_scripttags = []
+                               while search('<script\>', 'W') && line('.') < l
+                                       if matchstr(getline('.'), '<script[^>]*src') == ''
+                                               let js_scripttag = getline(line('.'), search('</script>', 'W'))
+                                               let js_scripttags += js_scripttag
+                                       endif
+                               endwhile
+                               let b:js_extfiles += js_scripttags
+
+                               " 3. Proper call for javascriptcomplete#CompleteJS
+                               call cursor(l,c)
+                               let js_context = matchstr(a:base, '\w\+$')
+                               let js_shortcontext = substitute(a:base, js_context.'$', '', '')
+                               let b:compl_context = context
+                               let b:jsrange = [l, l]
+                               unlet! l c
+                               "return map(javascriptcomplete#CompleteJS(0, js_context), 'js_shortcontext.v:val')
+                               return javascriptcomplete#CompleteJS(0, js_context)
+
+                       endif
+                               
+                       " }}}
+                       let stripbase = matchstr(context, ".*\\(on[a-zA-Z]*\\|style\\|class\\)\\s*=\\s*[\"']\\zs.*")
                        " Now we have context stripped from all chars up to style/class.
                        " It may fail with some strange style value combinations.
                        if stripbase !~ "[\"']"
                                return []
                        endif
                endif
+               " Value of attribute completion {{{
                " If attr contains =\s*[\"'] we catched value of attribute
                if attr =~ "=\s*[\"']"
                        " Let do attribute specific completion
@@ -413,6 +497,8 @@ function! htmlcomplete#CompleteTags(findstart, base)
                        return res + res2
 
                endif
+               " }}}
+               " Attribute completion {{{
                " Shorten context to not include last word
                let sbase = matchstr(context, '.*\ze\s.*')
                if tag =~ '^\(abbr\|acronym\|address\|b\|bdo\|big\|caption\|cite\|code\|dd\|dfn\|div\|dl\|dt\|em\|fieldset\|h\d\|hr\|i\|kbd\|li\|noscript\|ol\|p\|samp\|small\|span\|strong\|sub\|sup\|tt\|ul\|var\)$'
@@ -506,7 +592,8 @@ function! htmlcomplete#CompleteTags(findstart, base)
                return res + res2
 
        endif
-       " Close tag
+       " }}}
+       " Close tag {{{
        let b:unaryTagsStack = "base meta link hr br param img area input col"
        if context =~ '^\/'
                let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
@@ -521,10 +608,13 @@ function! htmlcomplete#CompleteTags(findstart, base)
                " If returns empty string assume <body>. Safe bet.
                let opentag = 'body'
        endif
-
+       " }}}
+       " Load data {{{
        if !exists("g:xmldata_xhtml10s")
                runtime! autoload/xml/xhtml10s.vim
        endif
+       " }}}
+       " Tag completion {{{
 
        let tags = g:xmldata_xhtml10s[opentag][0]
 
@@ -538,5 +628,7 @@ function! htmlcomplete#CompleteTags(findstart, base)
 
        return res + res2
 
+       " }}}
   endif
 endfunction
+" vim:set foldmethod=marker:
index 2853fbade1beabb9ea18b9da89d492f816dee6cc..0163fd9b7e12df045d7860a01e93148e4cbc248e 100644 (file)
@@ -1,33 +1,47 @@
 " Vim completion script
 " Language:    Java Script
 " Maintainer:  Mikolaj Machowski ( mikmach AT wp DOT pl )
-" Last Change: 2006 Jan 30
+" Last Change: 2006 Feb 6
 
 function! javascriptcomplete#CompleteJS(findstart, base)
   if a:findstart
-    " locate the start of the word
-    let line = getline('.')
-    let start = col('.') - 1
+       " locate the start of the word
+       let line = getline('.')
+       let start = col('.') - 1
        let curline = line('.')
        let compl_begin = col('.') - 2
        " Bit risky but JS is rather limited language and local chars shouldn't
        " fint way into names
-    while start >= 0 && line[start - 1] =~ '\w'
+       while start >= 0 && line[start - 1] =~ '\w'
                let start -= 1
-    endwhile
+       endwhile
        let b:compl_context = getline('.')[0:compl_begin]
-    return start
+       return start
   else
        " Initialize base return lists
-    let res = []
-    let res2 = []
+       let res = []
+       let res2 = []
        " a:base is very short - we need context
-       let context = b:compl_context
        " Shortcontext is context without a:base, useful for checking if we are
-       " looking for objects
+       " looking for objects and for what objects we are looking for
+       let context = b:compl_context
        let shortcontext = substitute(context, a:base.'$', '', '')
        unlet! b:compl_context
 
+       if exists("b:jsrange")
+               let file = getline(b:jsrange[0],b:jsrange[1])
+               unlet! b:jsrange
+
+               if len(b:js_extfiles) > 0
+                       let file = b:js_extfiles + file
+               endif
+
+       else
+               let file = getline(1, '$')
+       endif
+
+
+       " Completion of properties, methods, etc. {{{
        if shortcontext =~ '\.$'
                " Complete methods and properties for objects
                " DOM separate
@@ -91,7 +105,7 @@ function! javascriptcomplete#CompleteJS(findstart, base)
 
                " RegExp
                let regeprop = ['constructor', 'global', 'ignoreCase', 'lastIndex', 'multiline', 'source', 'prototype']
-               let regemeth = ['exec', 'toSource', 'toString', 'test', 'watch', 'unwatch']
+               let regemeth = ['exec', 'test', 'toSource', 'toString', 'watch', 'unwatch']
                call map(regemeth, 'v:val."("')
                let reges = regeprop + regemeth
 
@@ -106,19 +120,17 @@ function! javascriptcomplete#CompleteJS(findstart, base)
                let stris = striprop + strimeth
 
                " User created properties
-               if exists("b:jsrange")
-                       let file = getline(b:jsrange[0],b:jsrange[1])
-                       unlet! b:jsrange
-               else
-                       let file = getline(1, '$')
-               endif
                let user_props1 = filter(copy(file), 'v:val =~ "this\\.\\w"')
                let juser_props1 = join(user_props1, ' ')
                let user_props1 = split(juser_props1, '\zethis\.')
                unlet! juser_props1
                call map(user_props1, 'matchstr(v:val, "this\\.\\zs\\w\\+\\ze")')
+
                let user_props2 = filter(copy(file), 'v:val =~ "\\.prototype\\.\\w"')
-               call map(user_props2, 'matchstr(v:val, "\\.prototype\\.\\zs\\w\\+\\ze")')
+               let juser_props2 = join(user_props2, ' ')
+               let user_props2 = split(juser_props2, '\zeprototype\.')
+               unlet! juser_props2
+               call map(user_props2, 'matchstr(v:val, "prototype\\.\\zs\\w\\+\\ze")')
                let user_props = user_props1 + user_props2
 
                " HTML DOM properties
@@ -149,7 +161,15 @@ function! javascriptcomplete#CompleteJS(findstart, base)
                                        \ 'onClick', 'onDblClick', 'onFocus', 'onKeyDown', 'onKeyPress', 'onKeyUp',
                                        \ 'onMouseDown', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onResize']
                call map(documeth, 'v:val."("')
-               let docus = docuprop + documeth
+               let docuxprop = ['attributes', 'childNodes', 'doctype', 'documentElement', 'firstChild',
+                                       \ 'implementation', 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType',
+                                       \ 'nodeValue', 'ownerDocument', 'parentNode', 'previousSibling']
+               let docuxmeth = ['createAttribute', 'createCDATASection',
+                                       \ 'createComment', 'createDocument', 'createDocumentFragment',
+                                       \ 'createElement', 'createEntityReference', 'createProcessingInstruction',
+                                       \ 'createTextNode']
+               call map(docuxmeth, 'v:val."("')
+               let docus = docuprop + docuxprop + documeth + docuxmeth
                " Form - form.
                let formprop = ['elements', 'acceptCharset', 'action', 'encoding', 'enctype', 'id', 'length',
                                        \ 'method', 'name', 'tabIndex', 'target']
@@ -178,7 +198,7 @@ function! javascriptcomplete#CompleteJS(findstart, base)
                let ifras = ifraprop
                " Image - image.
                let imagprop = ['align', 'alt', 'border', 'complete', 'height', 'hspace', 'id', 'isMap', 'longDesc',
-                                       \ 'lowsrc', 'name', 'src', 'useMap', 'vspace', 'width']
+                                       \ 'lowSrc', 'name', 'src', 'useMap', 'vspace', 'width']
                let imagmeth = ['onAbort', 'onError', 'onLoad']
                call map(imagmeth, 'v:val."("')
                let imags = histprop + imagmeth
@@ -282,13 +302,13 @@ function! javascriptcomplete#CompleteJS(findstart, base)
                                        \ 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor',
                                        \ 'borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle',
                                        \ 'borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth',
-                    \ 'borderColor', 'borderStyle', 'borderWidth', 'margin', 'marginBottom',
-                    \ 'marginLeft', 'marginRight', 'marginTop', 'outline', 'outlineStyle', 'outlineWidth',
-                    \ 'outlineColor', 'outlineStyle', 'outlineWidth', 'padding', 'paddingBottom',
-                    \ 'paddingLeft', 'paddingRight', 'paddingTop',
-                    \ 'clear', 'clip', 'clipBottom', 'clipLeft', 'clipRight', 'clipTop', 'content',
-                    \ 'counterIncrement', 'counterReset', 'cssFloat', 'cursor', 'direction',
-                    \ 'display', 'markerOffset', 'marks', 'maxHeight', 'maxWidth', 'minHeight',
+                                       \ 'borderColor', 'borderStyle', 'borderWidth', 'margin', 'marginBottom',
+                                       \ 'marginLeft', 'marginRight', 'marginTop', 'outline', 'outlineStyle', 'outlineWidth',
+                                       \ 'outlineColor', 'outlineStyle', 'outlineWidth', 'padding', 'paddingBottom',
+                                       \ 'paddingLeft', 'paddingRight', 'paddingTop',
+                                       \ 'clear', 'clip', 'clipBottom', 'clipLeft', 'clipRight', 'clipTop', 'content',
+                                       \ 'counterIncrement', 'counterReset', 'cssFloat', 'cursor', 'direction',
+                                       \ 'display', 'markerOffset', 'marks', 'maxHeight', 'maxWidth', 'minHeight',
                                        \ 'minWidth', 'overflow', 'overflowX', 'overflowY', 'verticalAlign', 'visibility',
                                        \ 'width',
                                        \ 'listStyle', 'listStyleImage', 'listStylePosition', 'listStyleType',
@@ -320,13 +340,14 @@ function! javascriptcomplete#CompleteJS(findstart, base)
                " Textarea - accessible only by other properties
                let tareprop = ['accessKey', 'cols', 'defaultValue', 
                                        \ 'disabled', 'form', 'id', 'name', 'readOnly', 'rows', 
-                                       \ 'tabIndex', 'type', 'value'] 
+                                       \ 'tabIndex', 'type', 'value', 'selectionStart', 'selectionEnd'
                let taremeth = ['blur', 'focus', 'select', 'onBlur', 'onChange', 'onFocus']
                call map(taremeth, 'v:val."("')
                let tares = tareprop + taremeth
                " Window - window.
-               let windprop = ['frames', 'closed', 'defaultStatus', 'length', 'name', 'opener', 'parent',
-                                       \ 'self', 'status', 'top']
+               let windprop = ['frames', 'closed', 'defaultStatus', 'encodeURI', 'event', 'history',
+                                       \ 'length', 'location', 'name', 'onload', 'opener', 'parent', 'screen', 'self',
+                                       \ 'status', 'top', 'XMLHttpRequest', 'ActiveXObject']
                let windmeth = ['alert', 'blur', 'clearInterval', 'clearTimeout', 'close', 'confirm', 'focus',
                                        \ 'moveBy', 'moveTo', 'open', 'print', 'prompt', 'scrollBy', 'scrollTo', 'setInterval',
                                        \ 'setTimeout']
@@ -334,15 +355,81 @@ function! javascriptcomplete#CompleteJS(findstart, base)
                let winds = windprop + windmeth
                " XMLHttpRequest - access by new xxx()
                let xmlhprop = ['onreadystatechange', 'readyState', 'responseText', 'responseXML',
-                                       \ 'status', 'statusText']
+                                       \ 'status', 'statusText', 'parseError']
                let xmlhmeth = ['abort', 'getAllResponseHeaders', 'getResponseHeaders', 'open',
                                        \ 'send', 'setRequestHeader']
                call map(xmlhmeth, 'v:val."("')
                let xmlhs = xmlhprop + xmlhmeth
 
+               " XML DOM
+               " Attributes - element.attributes[x].
+               let xdomattrprop = ['name', 'specified', 'value']
+               " Element - anyelement.
+               let xdomelemprop = ['attributes', 'childNodes', 'firstChild', 'lastChild', 
+                                       \ 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType', 'nodeValue',
+                                       \ 'ownerDocument', 'parentNode', 'prefix', 'previousSibling', 'tagName']
+               let xdomelemmeth = ['appendChild', 'cloneNode', 'getAttribute', 'getAttributeNode',
+                                       \ 'getElementsByTagName', 'hasChildNodes', 'insertBefore', 'normalize',
+                                       \ 'removeAttribute', 'removeAttributeNode', 'removeChild', 'replaceChild',
+                                       \ 'setAttribute', 'setAttributeNode']
+               call map(xdomelemmeth, 'v:val."("')
+               let xdomelems = xdomelemprop + xdomelemmeth
+               " Node - anynode.
+               let xdomnodeprop = ['attributes', 'childNodes', 'firstChild', 'lastChild', 
+                                       \ 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType', 'nodeValue',
+                                       \ 'ownerDocument', 'parentNode', 'prefix', 'previousSibling']
+               let xdomnodemeth = ['appendChild', 'cloneNode',
+                                       \ 'hasChildNodes', 'insertBefore', 'removeChild', 'replaceChild']
+               call map(xdomnodemeth, 'v:val."("')
+               let xdomnodes = xdomnodeprop + xdomnodemeth
+               " NodeList 
+               let xdomnliss = ['length', 'item(']
+               " Error - parseError.
+               let xdomerror = ['errorCode', 'reason', 'line', 'linepos', 'srcText', 'url', 'filepos']
+
+               " Find object type declaration to reduce number of suggestions. {{{
+               " 1. Get object name
+               " 2. Find object declaration line
+               " 3. General declaration follows "= new Type" syntax, additional else
+               "    for regexp "= /re/"
+               " 4. Make correction for Microsoft.XMLHTTP ActiveXObject
+               " 5. Repeat for external files
                let object = matchstr(shortcontext, '\zs\w\+\ze\(\[.\{-}\]\)\?\.$')
-               let decl_line = search(object.'.\{-}=\s*new\s*', 'bn')
-               let object_type = matchstr(getline(decl_line), object.'.\{-}=\s*new\s*\zs\w\+\ze')
+               if len(object) > 0
+                       let decl_line = search(object.'.\{-}=\s*new\s*', 'bn')
+                       if decl_line > 0
+                               let object_type = matchstr(getline(decl_line), object.'.\{-}=\s*new\s*\zs\w\+\ze')
+                               if object_type == 'ActiveXObject' && matchstr(getline(decl_line), object.'.\{-}=\s*new\s*ActiveXObject\s*(.Microsoft\.XMLHTTP.)') != ''
+                                               let object_type = 'XMLHttpRequest'
+                               endif
+                       else
+                               let decl_line = search('var\s*'.object.'\s*=\s*\/', 'bn')
+                               if decl_line > 0
+                                       let object_type = 'RegExp'
+                               endif
+                       endif
+                       " We didn't find var declaration in current file but we may have
+                       " something in external files.
+                       if decl_line == 0 && exists("b:js_extfiles")
+                               let dext_line = filter(copy(b:js_extfiles), 'v:val =~ "'.object.'.\\{-}=\\s*new\\s*"')
+                               if len(dext_line) > 0
+                                       let object_type = matchstr(dext_line[-1], object.'.\{-}=\s*new\s*\zs\w\+\ze')
+                                       if object_type == 'ActiveXObject' && matchstr(dext_line[-1], object.'.\{-}=\s*new\s*ActiveXObject\s*(.Microsoft\.XMLHTTP.)') != ''
+                                                       let object_type = 'XMLHttpRequest'
+                                       endif
+                               else
+                                       let dext_line = filter(copy(b:js_extfiles), 'v:val =~ "var\s*'.object.'\\s*=\\s*\\/"')
+                                       if len(dext_line) > 0
+                                               let object_type = 'RegExp'
+                                       endif
+                               endif
+                       endif
+               endif
+               " }}}
+
+               if !exists('object_type')
+                       let object_type = ''
+               endif
 
                if object_type == 'Date'
                        let values = dates
@@ -357,13 +444,17 @@ function! javascriptcomplete#CompleteJS(findstart, base)
                        let values = xmlhs
                elseif object_type == 'String'
                        let values = stris
+               elseif object_type == 'RegExp'
+                       let values = reges
+               elseif object_type == 'Math'
+                       let values = maths
                endif
 
                if !exists('values')
                " List of properties
                if shortcontext =~ 'Math\.$'
                        let values = maths
-               elseif shortcontext =~ 'anchor\.$'
+               elseif shortcontext =~ 'anchors\(\[.\{-}\]\)\?\.$'
                        let values = anths
                elseif shortcontext =~ 'area\.$'
                        let values = areas
@@ -373,7 +464,7 @@ function! javascriptcomplete#CompleteJS(findstart, base)
                        let values = bodys
                elseif shortcontext =~ 'document\.$'
                        let values = docus
-               elseif shortcontext =~ 'form\.$'
+               elseif shortcontext =~ 'forms\(\[.\{-}\]\)\?\.$'
                        let values = forms
                elseif shortcontext =~ 'frameset\.$'
                        let values = fsets
@@ -381,9 +472,9 @@ function! javascriptcomplete#CompleteJS(findstart, base)
                        let values = hists
                elseif shortcontext =~ 'iframe\.$'
                        let values = ifras
-               elseif shortcontext =~ 'image\.$'
+               elseif shortcontext =~ 'images\(\[.\{-}\]\)\?\.$'
                        let values = imags
-               elseif shortcontext =~ 'link\.$'
+               elseif shortcontext =~ 'links\(\[.\{-}\]\)\?\.$'
                        let values = links
                elseif shortcontext =~ 'location\.$'
                        let values = locas
@@ -405,11 +496,16 @@ function! javascriptcomplete#CompleteJS(findstart, base)
                        let values = trows
                elseif shortcontext =~ 'window\.$'
                        let values = winds
+               elseif shortcontext =~ 'parseError\.$'
+                       let values = xdomerror
+               elseif shortcontext =~ 'attributes\[\d\+\]\.$'
+                       let values = xdomattrprop
                else
                        let values = user_props + arrays + dates + funcs + maths + numbs + objes + reges + stris
                        let values += doms + anths + areas + bases + bodys + docus + forms + frams + fsets + hists
-                       let values += ifras + imags + links + locas + metas + navis + objes + scres + styls
-                       let values += tabls + trows + winds
+                       let values += ifras + imags + links + locas + metas + navis + objes + scres
+                       let values += tabls + trows + tares + winds
+                       let values += xdomnodes + xdomnliss + xdomelems
                endif
                endif
 
@@ -425,21 +521,15 @@ function! javascriptcomplete#CompleteJS(findstart, base)
                return res + res2
 
        endif
-
-       if exists("b:jsrange")
-               let file = getline(b:jsrange[0],b:jsrange[1])
-               unlet! b:jsrange
-       else
-               let file = getline(1, '$')
-       endif
+       " }}}
 
        " Get variables data.
        let variables = filter(copy(file), 'v:val =~ "var\\s"')
        call map(variables, 'matchstr(v:val, ".\\{-}var\\s\\+\\zs.*\\ze")')
        call map(variables, 'substitute(v:val, ";\\|$", ",", "g")')
        let vars = []
-       " This loop is necessary to get variable names from constructs like:
-       " var var1, var2, var3 = "something";
+       " This loop (and next one) is necessary to get variable names from
+       " constructs like: var var1, var2, var3 = "something";
        for i in range(len(variables))
                let comma_separated = split(variables[i], ',\s*')
                call map(comma_separated, 'matchstr(v:val, "\\w\\+")')
@@ -447,27 +537,36 @@ function! javascriptcomplete#CompleteJS(findstart, base)
        endfor
 
        let variables = sort(vars)
+       unlet! vars
 
-       " Add undeclared variables.
+       " Add "no var" variables.
        let undeclared_variables = filter(copy(file), 'v:val =~ "^\\s*\\w\\+\\s*="')
-       call map(undeclared_variables, 'matchstr(v:val, "^\\s*\\zs\\w\\+\\ze")')
+       let u_vars = []
+       for i in range(len(undeclared_variables))
+               let  split_equal = split(undeclared_variables[i], '\s*=')
+               call map(split_equal, 'matchstr(v:val, "\\w\\+$")')
+               let u_vars += split_equal
+       endfor
 
-       let variables += sort(undeclared_variables)
+       let variables += sort(u_vars)
+       unlet! u_vars
 
        " Get functions
        let functions = filter(copy(file), 'v:val =~ "^\\s*function\\s"')
        let arguments = copy(functions)
        call map(functions, 'matchstr(v:val, "^\\s*function\\s\\+\\zs\\w\\+")')
        call map(functions, 'v:val."("')
+       let functions = sort(functions)
 
        " Get functions arguments
        call map(arguments, 'matchstr(v:val, "function.\\{-}(\\zs.\\{-}\\ze)")')
        let jargs = join(arguments, ',')
        let jargs = substitute(jargs, '\s', '', 'g')
        let arguments = split(jargs, ',')
+       let arguments = sort(arguments)
 
        " Built-in functions
-       let builtin = []
+       let builtin = ['alert(', 'confirm(']
 
        " Top-level HTML DOM objects
        let htmldom = ['document', 'anchor', 'area', 'base', 'body', 'document', 'event', 'form', 'frame', 'frameset', 'history', 'iframe', 'image', 'input', 'link', 'location', 'meta', 'navigator', 'object', 'option', 'screen', 'select', 'table', 'tableData', 'tableHeader', 'tableRow', 'textarea', 'window']
@@ -493,3 +592,5 @@ function! javascriptcomplete#CompleteJS(findstart, base)
 
        return res + res2
 endfunction
+
+" vim:set foldmethod=marker:
index fc4ad7844e8cd0a829d8e507224269bd4c04dee2..0d104a0e9a1d2f6c1602af4bd31636be60eaae83 100644 (file)
@@ -1,7 +1,7 @@
 " Vim completion script
 " Language:    XML
 " Maintainer:  Mikolaj Machowski ( mikmach AT wp DOT pl )
-" Last Change: 2006 Jan 24
+" Last Change: 2006 Feb 6
 
 " This function will create Dictionary with users namespace strings and values
 " canonical (system) names of data files.  Names should be lowercase,
@@ -396,11 +396,11 @@ return ''
 endfunction
 
 function! s:InComment()
-       return synIDattr(synID(line('.'), col('.'), 0), 'name') =~ 'Comment'
+       return synIDattr(synID(line('.'), col('.'), 0), 'name') =~ 'Comment\|String'
 endfunction
 
 function! s:InCommentAt(line, col)
-       return synIDattr(synID(a:line, a:col, 0), 'name') =~ 'Comment'
+       return synIDattr(synID(a:line, a:col, 0), 'name') =~ 'Comment\|String'
 endfunction
 
 function! s:SetKeywords()
index 567758669b9a969921a032b6d7848463fbf81c6f..a229f9d0917ef6318dd292522180fe9012a69f21 100644 (file)
@@ -1235,6 +1235,7 @@ The commands are sorted on the non-optional part of their name.
 |:lgetfile|    :lg[etfile]     read file with locations
 |:lgrep|       :lgr[ep]        run 'grepprg' and jump to first match
 |:lgrepadd|    :lgrepa[dd]     like :grep, but append to current list
+|:lhelpgrep|   :lh[elpgrep]    like ":helpgrep" but uses location list
 |:ll|          :ll             go to specific location
 |:llast|       :lla[st]        go to the specified location, default last one
 |:llist|       :lli[st]        list all locations
index 88be8cbf31def3751eb9f32c276fd30b0a14dbde..d1e01049a3f99af0568309258d9dd8024b4af577 100644 (file)
@@ -1,4 +1,4 @@
-*insert.txt*    For Vim version 7.0aa.  Last change: 2006 Jan 30
+*insert.txt*    For Vim version 7.0aa.  Last change: 2006 Feb 07
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -956,39 +956,61 @@ FUNCTIONS FOR FINDING COMPLETIONS                 *complete-functions*
 
 This applies to 'completefunc' and 'omnifunc'.
 
-The function will be invoked with two arguments.  First the function is called
-to find the start of the text to be completed.  Secondly the function is
-called to actually find the matches.
+The function is called in two different ways:
+- First the function is called to find the start of the text to be completed.
+- Later the function is called to actually find the matches.
 
 On the first invocation the arguments are:
    a:findstart  1
    a:base      empty
 
-The function must return the column of where the completion starts.  It must
-be a number between zero and the cursor column "col('.')".  This involves
-looking at the characters just before the cursor and including those
-characters that could be part of the completed item.  The text between this
-column and the cursor column will be replaced with the matches.  Return -1 if
-no completion can be done.
+The function must return the column where the completion starts.  It must be a
+number between zero and the cursor column "col('.')".  This involves looking
+at the characters just before the cursor and including those characters that
+could be part of the completed item.  The text between this column and the
+cursor column will be replaced with the matches.  Return -1 if no completion
+can be done.
 
 On the second invocation the arguments are:
    a:findstart  0
-   a:base      the text with which matches should match, what was
+   a:base      the text with which matches should match; the text that was
                located in the first call (can be empty)
 
 The function must return a List with the matching words.  These matches
 usually include the "a:base" text.  When there are no matches return an empty
-List.  When one of the items in the list cannot be used as a string (e.g., a
-Dictionary) then an error message is given and further items in the list are
-not used.
+List.
+
+Each list item can either be a string or a Dictionary.  When it is a string it
+is used as the completion.  When it is a Dictionary it can contain these
+items:
+       word            the completion, mandatory
+       menu            extra text for the popup menu
+       info            more information about the item
+       kind            single letter indicating the type of completion
+
+All of these must be a string.  If an item does not meet these requirements
+then an error message is given and further items in the list are not used.
+You can mix string and Dictionary items in the returned list.
+
+The "menu" item is used in the popup menu and may be truncated, thus it should
+be relatively short.  The "info" item can be longer, it may be displayed in a
+balloon.
+
+The "kind" item uses a single letter to indicate the kind of completion.  This
+may be used to show the completion differently (different color or icon).
+Currently these types can be used:
+       v       variable
+       f       function or method
+       c       composite (struct, object)
 
 When searching for matches takes some time call |complete_add()| to add each
 match to the total list.  These matches should then not appear in the returned
 list!  Call |complete_check()| now and then to allow the user to press a key
 while still searching for matches.  Stop searching when it returns non-zero.
 
-The function may move the cursor, it is restored afterwards.  This option
-cannot be set from a |modeline| or in the |sandbox|, for security reasons.
+The function is allowed to move the cursor, it is restored afterwards.  This
+option cannot be set from a |modeline| or in the |sandbox|, for security
+reasons.
 
 An example that completes the names of the months: >
        fun! CompleteMonths(findstart, base)
@@ -1050,11 +1072,16 @@ The menu is used when:
 - 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
-<PageUp>:        Select a match several entries back
-<PageDown>:      Select a match several entries further
+<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
+<PageUp>         Select a match several entries back
+<PageDown>       Select a match several entries further
+<BS> and CTRL-H   Delete one character, find the matches for the shorter word
+                 before the cursor.  This may find more matches.
+CTRL-L           Add one character from the current match, may reduce the
+                 number of matches.  Does not work after selecting one of the
+                 matches with CTRL-N, <Up>, etc.
 
 The colors of the menu can be changed with these highlight groups:
 Pmenu          normal item  |hl-Pmenu|
@@ -1073,6 +1100,8 @@ because it adds extra information that is needed for completion.  You can find
 it here: http://ctags.sourceforge.net/
 For version 5.5.4 you should add a patch that adds the "typename:" field:
 ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
+A compiled .exe for MS-Windows can be found at:
+http://georgevreilly.com/vim/ctags.html
 
 If you want to complete system functions you can do something like this.  Use
 ctags to generate a tags file for all the system header files: >
@@ -1104,14 +1133,14 @@ Complete properties and their appropriate values according to CSS 2.1
 specification. 
 
 
-(X)HTML                                                        *ft-html-omni*
+HTML and XHTML                                         *ft-html-omni*
                                                        *ft-xhtml-omni*
 
 CTRL-X CTRL-O provides completion of various elements of (X)HTML files.
 It is designed to support writing of XHTML 1.0 Strict files but will
 also works for other versions of HTML. Features:
 
-- after "<" complete tag name depending on context (no div suggest
+- after "<" complete tag name depending on context (no div suggestion
   inside of an a tag)
 - inside of tag complete proper attributes (no width attribute for an
   a tag)
@@ -1120,17 +1149,21 @@ also works for other versions of HTML. Features:
 - complete names of entities
 - complete values of "class" and "id" attributes with data obtained from
   style tag and included CSS files
-- when completing "style" attribute or working inside of "style" tag
+- when completing value of "style" attribute or working inside of "style" tag
   switch to |ft-css-omni| completion
+- when completing values of events attributes or working inside of "script" tag
+  switch to |ft-javascript-omni| completion
 - when used after "</" CTRL-X CTRL-O will close the last opened tag
 
 Note: When used first time completion menu will be shown with little delay
-- this is time needed for loading of data file.
+- this is time needed for loading of data file.  
+Note: Completion may fail in badly formatted documents. In such case try to
+run |:make| command to detect formatting problems.
 
 
 JAVASCRIPT                                             *ft-javascript-omni*
 
-Completion of most elements of JavaScript language and HTML DOM.
+Completion of most elements of JavaScript language and DOM elements.
 
 Complete:
 
@@ -1138,13 +1171,13 @@ Complete:
 - function name
 - function arguments
 - properties of variables trying to detect type of variable
-- complete HTML DOM objects and properties depending on context
+- complete DOM objects and properties depending on context
 - keywords of language
 
-Completion works in separate JavaScript files (&ft==javascript) and inside of
-<script> tag of (X)HTML. Note: scanning will be only in scope of current tag.
-At the moment separate files are not taken into account.
-
+Completion works in separate JavaScript files (&ft==javascript), inside of
+<script> tag of (X)HTML and in values of event attributes (including scanning
+of external files.
 DOM compatibility
 
 At the moment (beginning of 2006) there are two main browsers - MS Internet
index d642497cc81beb3aab642711853f7313a367e874..71f8f8e1701b0ebda7c8f0d8b40596874499ca0b 100644 (file)
@@ -1,4 +1,4 @@
-*netbeans.txt*  For Vim version 7.0aa.  Last change: 2005 Apr 04
+*netbeans.txt*  For Vim version 7.0aa.  Last change: 2006 Feb 05
 
 
                  VIM REFERENCE MANUAL    by Gordon Prieur
@@ -179,6 +179,7 @@ These messages are specific for NetBeans:
 Region is guarded, cannot modify
                NetBeans defines guarded areas in the text, which you cannot
                change.
+               Also sets the current buffer, if necessary.
 
                                                        *E656*
 NetBeans disallows writes of unmodified buffers
@@ -485,8 +486,10 @@ setContentType
                Not implemented.
 
 setDot off     Make the buffer the current buffer and set the cursor at the
-               specified position.  If there are folds they are opened to
-               make the cursor line visible.
+               specified position.  If the buffer is open in another window
+               than make that window the current window.
+               If there are folds they are opened to make the cursor line
+               visible.
                In version 2.1 "lnum/col" can be used instead of "off".
 
 setExitDelay seconds
@@ -566,6 +569,7 @@ stopDocumentListen
 
 unguard off len
                Opposite of "guard", remove guarding for a text area.
+               Also sets the current buffer, if necessary.
 
 version                Not implemented.
 
@@ -612,6 +616,7 @@ insert off text
                        123             no problem
                        123 !message    failed
                Note that the message in the reply is not quoted.
+               Also sets the current buffer, if necessary.
 
 remove off length
                Delete "length" bytes of text at position "off".  Both
@@ -620,6 +625,7 @@ remove off length
                        123             no problem
                        123 !message    failed
                Note that the message in the reply is not quoted.
+               Also sets the current buffer, if necessary.
 
 saveAndExit    Perform the equivalent of closing Vim: ":confirm qall".
                If there are no changed files or the user does not cancel the
index 4d69b877e52d571e2b34c10d96c70e19bed44003..54cd9dd7615687a0b372d80731e16c62e32e136b 100644 (file)
@@ -2151,6 +2151,8 @@ $VIMRUNTIME       starting.txt    /*$VIMRUNTIME*
 :lgrep quickfix.txt    /*:lgrep*
 :lgrepa        quickfix.txt    /*:lgrepa*
 :lgrepadd      quickfix.txt    /*:lgrepadd*
+:lh    various.txt     /*:lh*
+:lhelpgrep     various.txt     /*:lhelpgrep*
 :list  various.txt     /*:list*
 :ll    quickfix.txt    /*:ll*
 :lla   quickfix.txt    /*:lla*
@@ -5420,7 +5422,6 @@ hebrew    hebrew.txt      /*hebrew*
 hebrew.txt     hebrew.txt      /*hebrew.txt*
 help   various.txt     /*help*
 help-context   help.txt        /*help-context*
-help-tags      tags    1
 help-translated        various.txt     /*help-translated*
 help-xterm-window      various.txt     /*help-xterm-window*
 help.txt       help.txt        /*help.txt*
index ab46f8383421253d5aa2b4a10b7910828027aa5d..95df11bc8ce8d1757ec061da1c8d5c4fd98c76e7 100644 (file)
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.0aa.  Last change: 2006 Feb 04
+*todo.txt*      For Vim version 7.0aa.  Last change: 2006 Feb 07
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -30,25 +30,19 @@ be worked on, but only if you sponsor Vim development.  See |sponsor|.
                                                        *known-bugs*
 -------------------- Known bugs and current work -----------------------
 
-Variant of ":helpgrep" that uses a location list?  How about:
-    :lhelpgrep  (use local list in help window, not current window)
+Crash with X command server (Ciaran McCreesh).
 
 ccomplete / omnicomplete:
-- Extra info for each entry to show in a tooltip kind of thing.
-    Should use a dictionary for each entry.  Fields could be:
-       word    the completed word
-       menu    menu text (use word when missing)
-       info    extra info, to be displayed in balloon (e.g., function args)
-       kind    single letter indicating the type of word:
-                   v = variable, f = function/method, c = composite (object,
-                   struct pointer).
-  For C add tag "kind" field?
+When editing compl_leader <CR> should accept the current match.
+Somehow select another match without changing the compl_leader, so that you
+can use CTRL-L next?  Perhaps with <S-Up> and <S-Down>?
 - Complete the longest common match instead of the first match?
     Do this when "longest" is in 'completeopt'.
     Pressing CTRL-N or CTRL-P will get the whole match, as before.
     Need to postpone inserting anything until all matches have been found.
     Then add a completion item with the longest common string (after what was
     typed), if there is one.
+- For C add tag "kind" field to each match?
 - Finding out if an item has members (to add '.' or '->') requires a grep in
   the tags files, that is very slow.  Is there another solution?  At least
   stop at the first match.
@@ -109,6 +103,9 @@ Nov 24)
 An error in a function uses a line number that doesn't take line continuation
 into account. (Mikolaj Machowski)  Store line count in an extra array?
 
+Is it possible to keep the command-line window open?  Would actually work like
+closing it, executing the command and re-opening it (at the same position).
+
 Mac unicode patch (Da Woon Jung):
 - selecting proportional font breaks display
 - UTF-8 text causes display problems.  Font replacement causes this.
index 4cb9687cd5aa5edb88e1e2b9792a8809ac959a64..a7cb74348a842540978a636775bd2d7386fbb87f 100644 (file)
@@ -648,6 +648,15 @@ g CTRL-A           Only when Vim was compiled with MEM_PROFILING defined
                        compresses the help files).
                        {not in Vi}
 
+                                                       *:lh* *:lhelpgrep*
+:lh[elpgrep] {pattern}[@xx]
+                       Same as ":helpgrep", except the location list is used
+                       instead of the quickfix list. If the help window is
+                       already opened, then the location list for that window
+                       is used. Otherwise, a new help window is opened and
+                       the location list for that window is set.  The
+                       location list for the current window is not changed.
+
                                                        *:exu* *:exusage*
 :exu[sage]             Show help on Ex commands.  Added to simulate the Nvi
                        command. {not in Vi}
index d0d1e85cc645ea8c84bd7fd6424f7fcacd9a2d74..ced704f3ba246de38f1a76f7164782ef5384f394 100644 (file)
@@ -1,4 +1,4 @@
-*version7.txt*  For Vim version 7.0aa.  Last change: 2006 Feb 04
+*version7.txt*  For Vim version 7.0aa.  Last change: 2006 Feb 05
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -192,8 +192,8 @@ Omni completion                                     *new-omni-completion*
 
 This could also be called "intellisense", but that is a trademark.  It is a
 smart kind of completion.  The text in front of the cursor is inspected to
-figure out what could be following.  This considers struct and class members,
-unions, etc.
+figure out what could be following.  This may suggest struct and class
+members, system functions, etc.
 
 Use CTRL-X CTRL-O in Insert mode to start the completion.  |i_CTRL-X_CTRL-O|
 
@@ -201,8 +201,11 @@ The 'omnifunc' option is set by filetype plugins to define the function that
 figures out the completion.
 
 Currently supported languages:
-       C       |ft-c-omni|
-       XHTML   |ft-html-omni|
+       C                                       |ft-c-omni|
+       (X)HTML with CSS                        |ft-html-omni|
+       JavaScript                              |ft-javascript-omni|
+       any language wih syntax highligting     |ft-syntax-omni|
+       XML                                     |ft-xml-omni|
 
 When the 'completeopt' option contains "menu" then matches for Insert mode
 completion are displayed in a popup menu.
@@ -460,7 +463,30 @@ Win32: The ":winpos" command now also works in the console. (Vipin Aravind)
 |:lgrepadd|            Like |:grepadd| but use the location list.
 |:lvimgrep|            Like |:vimgrep| but use the location list.
 |:lvimgrepadd|         Like |:vimgrepadd| but use the location list.
+|:lhelpgrep|           Like |:helpgrep| but use the location list.
+|:lfile|               Like |:cfile| but use the location list.
+|:lgetfile|            Like |:cgetfile| but use the location list.
+|:laddfile|            Like |:caddfile| but use the location list.
+|:lbuffer|             Like |:cbuffer| but use the location list.
 |:laddbuffer|          Like |:caddbuffer| but use the location list.
+|:lexpr|               Like |:cexpr| but use the location list.
+|:laddexpr|            Like |:caddexpr| but use the location list.
+|:ll|                  Like |:cc| but use the location list.
+|:llist|               Like |:clist| but use the location list.
+|:lnext|               Like |:cnext| but use the location list.
+|:lprev|               Like |:cprev| but use the location list.
+|:lNext|               Like |:cNext| but use the location list.
+|:lfirst|              Like |:cfirst| but use the location list.
+|:lrewind|             Like |:crewind| but use the location list.
+|:llast|               Like |:clast| but use the location list.
+|:lnfile|              Like |:cnfile| but use the location list.
+|:lpfile|              Like |:cpfile| but use the location list.
+|:lNfile|              Like |:cNfile| but use the location list.
+|:lolder|              Like |:colder| but use the location list.
+|:lnewer|              Like |:cnewer| but use the location list.
+|:lwindow|             Like |:cwindow| but use the location list.
+|:lopen|               Like |:copen| but use the location list.
+|:lclose|              Like |:cclose| but use the location list.
 
 
 Ex command modifiers: ~
index cc28c6a9759d03d920aea5ae005bfea0b48e98ad..a8a3c612c13d5049d896c4213a067c43cc4934ee 100644 (file)
@@ -1,8 +1,8 @@
 " Vim settings file
 " Language:     LambdaProlog (Teyjus)
-" Maintainer:   Markus Mottl  <markus@oefai.at>
-" URL:          http://www.oefai.at/~markus/vim/ftplugin/lprolog.vim
-" Last Change:  2001 Oct 02 - fixed uncommenting bug (MM)
+" Maintainer:   Markus Mottl  <markus.mottl@gmail.com>
+" URL:          http://www.ocaml.info/vim/ftplugin/lprolog.vim
+" Last Change:  2006 Feb 05
 "               2001 Sep 16 - fixed 'no_mail_maps'-bug (MM)
 "               2001 Sep 02 - initial release  (MM)
 
index 322be55f85ac13fb5a0176b3d03284255db0f2ca..6f2b17cb7e03f8c93374085154716fa94829afc7 100644 (file)
@@ -4,7 +4,7 @@
 "              Markus Mottl        <markus.mottl@gmail.com>
 "              Stefano Zacchiroli  <zack@bononia.it>
 " URL:         http://www.ocaml.info/vim/ftplugin/ocaml.vim
-" Last Change: 2005 Oct 13 - removed GPL; better matchit support (MM, SZ)
+" Last Change: 2006 Feb 05
 "
 " if exists("b:did_ftplugin")
 "   finish
@@ -377,4 +377,3 @@ let &cpoptions=s:cposet
 unlet s:cposet
 
 " vim:sw=2
-
index 64255000bd76dc608297b9849f96df156b2bc500..507f72e2810f4d4e3b85a91b87bf53a195e0c889 100644 (file)
@@ -1,9 +1,9 @@
 " Vim syntax file
 " Language:     Dot
 " Filenames:    *.dot
-" Maintainer:   Markus Mottl  <markus@oefai.at>
-" URL:          http://www.oefai.at/~markus/vim/syntax/dot.vim
-" Last Change:  2004 Jul 26
+" Maintainer:   Markus Mottl  <markus.mottl@gmail.com>
+" URL:          http://www.ocaml.info/vim/syntax/dot.vim
+" Last Change:  2006 Feb 05
 "               2001 May 04 - initial version
 
 " For version 5.x: Clear all syntax items
index 7007f239fad8a732cf31b0876f4fa241c5f08360..086c00fd5ddd5704a52e923472efc275a1e7b182 100644 (file)
@@ -1,9 +1,9 @@
 " Vim syntax file
 " Language:     LambdaProlog (Teyjus)
 " Filenames:    *.mod *.sig
-" Maintainer:   Markus Mottl  <markus@oefai.at>
-" URL:          http://www.oefai.at/~markus/vim/syntax/lprolog.vim
-" Last Change:  2004 Jul 26
+" Maintainer:   Markus Mottl  <markus.mottl@gmail.com>
+" URL:          http://www.ocaml.info/vim/syntax/lprolog.vim
+" Last Change:  2006 Feb 05
 "               2001 Apr 26 - Upgraded for new Vim version
 "               2000 Jun  5 - Initial release
 
index 5aa1e4de8d9b95733da5ce9b0977fb6058291601..74f96bc23aeaef257c519f56b178949b65fca37e 100644 (file)
@@ -2,8 +2,8 @@
 " Language:            shell (sh) Korn shell (ksh) bash (sh)
 " Maintainer:          Dr. Charles E. Campbell, Jr.  <NdrOchipS@PcampbellAfamily.Mbiz>
 " Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
-" Last Change:         Dec 29, 2005
-" Version:             79
+" Last Change:         Feb 01, 2006
+" Version:             80
 " URL:         http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
 "
 " Using the following VIM variables: {{{1
@@ -173,7 +173,7 @@ syn match  shComma     contained    ","
 " ====
 syn match   shCaseBar  contained skipwhite "[^|"`'()]\{-}|"hs=e                nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
 syn match   shCaseStart        contained skipwhite skipnl "("                  nextgroup=shCase,shCaseBar
-syn region  shCase     contained skipwhite skipnl matchgroup=shSnglCase start="[^#$()]\{-})"ms=s,hs=e  end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,,shComment
+syn region  shCase     contained skipwhite skipnl matchgroup=shSnglCase start="[^#$()'"]\{-})"ms=s,hs=e  end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment
 syn region  shCaseEsac matchgroup=shConditional start="\<case\>" end="\<esac\>"        contains=@shCaseEsacList
 syn keyword shCaseIn   contained skipwhite skipnl in                   nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
 if exists("b:is_bash")
@@ -181,7 +181,7 @@ if exists("b:is_bash")
 else
  syn region  shCaseExSingleQuote       matchgroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+   contains=shStringSpecial        skipwhite skipnl nextgroup=shCaseBar    contained
 endif
-syn region  shCaseSingleQuote  matchgroup=shOperator start=+'+ end=+'+ contains=shStringSpecial                skipwhite skipnl nextgroup=shCaseBar    contained
+syn region  shCaseSingleQuote  matchgroup=shOperator start=+'+ end=+'+         contains=shStringSpecial                skipwhite skipnl nextgroup=shCaseBar    contained
 syn region  shCaseDoubleQuote  matchgroup=shOperator start=+"+ skip=+\\\\\|\\.+ end=+"+        contains=@shDblQuoteList,shStringSpecial        skipwhite skipnl nextgroup=shCaseBar    contained
 syn region  shCaseCommandSub   start=+`+ skip=+\\\\\|\\.+ end=+`+              contains=@shCommandSubList              skipwhite skipnl nextgroup=shCaseBar    contained
 
index 5f6a862171f868cfd73f42f82a23f05295ba8101..a45b204a831f7be0c1b0dee78036ece865e619be 100644 (file)
@@ -1,10 +1,10 @@
 " Vim syntax file
 " Language:     SML
 " Filenames:    *.sml *.sig
-" Maintainers:  Markus Mottl            <markus@oefai.at>
+" Maintainers:  Markus Mottl            <markus.mottl@gmail.com>
 "               Fabrizio Zeno Cornelli  <zeno@filibusta.crema.unimi.it>
-" URL:          http://www.oefai.at/~markus/vim/syntax/sml.vim
-" Last Change:  2004 Jul 26
+" URL:          http://www.ocaml.info/vim/syntax/sml.vim
+" Last Change:  2006 Feb 05
 "               2001 Nov 20 - Fixed small highlighting bug with modules (MM)
 "               2001 Aug 29 - Fixed small highlighting bug  (MM)
 
index 613a16cd44de0101952b07f2bf6acb74804079a0..a8543fc9f81a77a9806fd7e81e4a7235707aba7d 100644 (file)
@@ -1,8 +1,8 @@
 " Vim syntax file
 " Language:    Vim 7.0 script
 " Maintainer:  Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: January 30, 2006
-" Version:     7.0-23
+" Last Change: February 07, 2006
+" Version:     7.0-25
 " Automatically generated keyword lists: {{{1
 
 " Quit when a syntax file was already loaded {{{2
@@ -16,7 +16,7 @@ syn keyword vimTodo contained COMBAK  NOT     RELEASED        TODO    WIP
 syn cluster vimCommentGroup    contains=vimTodo,@Spell
 
 " regular vim commands {{{2
-syn keyword vimCommand contained       ab[breviate] abc[lear] abo[veleft] al[l] arga[dd] argd[elete] argdo arge[dit] argg[lobal] argl[ocal] ar[gs] argu[ment] as[cii] bad[d] ba[ll] bd[elete] be bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bN[ext] bo[tright] bp[revious] brea[k] breaka[dd] breakd[el] breakl[ist] br[ewind] bro[wse] bufdo b[uffer] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cad[dexpr] caddf[ile] cal[l] cat[ch] cb[uffer] cc ccl[ose] cd ce[nter] cex[pr] cf[ile] cfir[st] cg[etfile] c[hange] changes chd[ir] che[ckpath] checkt[ime] cla[st] cl[ist] clo[se] cmapc[lear] cnew[er] cn[ext] cN[ext] cnf[ile] cNf[ile] cnorea[bbrev] col[der] colo[rscheme] comc[lear] comp[iler] conf[irm] con[tinue] cope[n] co[py] cpf[ile] cp[revious] cq[uit] cr[ewind] cuna[bbrev] cu[nmap] cw[indow] debugg[reedy] delc[ommand] d[elete] DeleteFirst delf[unction] delm[arks] diffg[et] diffoff diffpatch diffpu[t] diffsplit diffthis diffu[pdate] dig[raphs] di[splay] dj[ump] dl[ist] dr[op] ds[earch] dsp[lit] echoe[rr] echom[sg] echon e[dit] el[se] elsei[f] em[enu] emenu* endfo[r] endf[unction] en[dif] endt[ry] endw[hile] ene[w] ex exi[t] Explore exu[sage] f[ile] files filetype fina[lly] fin[d] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] folddoc[losed] foldd[oopen] foldo[pen] for fu[nction] g[lobal] go[to] gr[ep] grepa[dd] ha[rdcopy] h[elp] helpf[ind] helpg[rep] helpt[ags] Hexplore hid[e] his[tory] I ia[bbrev] iabc[lear] if ij[ump] il[ist] imapc[lear] inorea[bbrev] is[earch] isp[lit] iuna[bbrev] iu[nmap] j[oin] ju[mps] k keepalt keepj[umps] kee[pmarks] lad[dexpr] laddf[ile] lan[guage] la[st] lb[uffer] lc[d] lch[dir] lcl[ose] le[ft] lefta[bove] lex[pr] lf[ile] lfir[st] lg[etfile] l[ist] ll lla[st] lli[st] lm[ap] lmapc[lear] lnew[er] lne[xt] lN[ext] lnf[ile] lNf[ile] ln[oremap] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lpf[ile] lp[revious] lr[ewind] ls lu[nmap] lw[indow] mak[e] ma[rk] marks mat[ch] menut[ranslate] mk[exrc] mks[ession] mksp[ell] mkvie[w] mkv[imrc] mod[e] m[ove] mzf[ile] mz[scheme] nbkey NetrwSettings new n[ext] N[ext] nmapc[lear] noh[lsearch] norea[bbrev] Nread nu[mber] nun[map] Nw omapc[lear] on[ly] o[pen] opt[ions] ou[nmap] pc[lose] ped[it] pe[rl] perld[o] po[p] popu popu[p] pp[op] pre[serve] prev[ious] p[rint] P[rint] profd[el] prof[ile] prompt promptf[ind] promptr[epl] ps[earch] pta[g] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptN[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] pyf[ile] py[thon] qa[ll] q[uit] quita[ll] r[ead] rec[over] redi[r] red[o] redr[aw] redraws[tatus] reg[isters] res[ize] ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] rub[y] rubyd[o] rubyf[ile] ru[ntime] rv[iminfo] sal[l] san[dbox] sa[rgument] sav[eas] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbN[ext] sbp[revious] sbr[ewind] sb[uffer] scripte[ncoding] scrip[tnames] se[t] setf[iletype] setg[lobal] setl[ocal] Sexplore sf[ind] sfir[st] sh[ell] sign sil[ent] sim[alt] sla[st] sl[eep] sm[agic] sn[ext] sN[ext] sni[ff] sno[magic] sor[t] so[urce] spelld[ump] spe[llgood] spellr[epall] spellw[rong] sp[lit] spr[evious] sre[wind] sta[g] startg[replace] star[tinsert] startr[eplace] stj[ump] st[op] stopi[nsert] sts[elect] sun[hide] sus[pend] sv[iew] syncbind t ta[g] tags tc[l] tcld[o] tclf[ile] te[aroff] tf[irst] the th[row] tj[ump] tl[ast] tm tm[enu] tn[ext] tN[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] tu tu[nmenu] una[bbreviate] u[ndo] unh[ide] unlo[ckvar] unm[ap] up[date] verb[ose] ve[rsion] vert[ical] Vexplore v[global] vie[w] vim[grep] vimgrepa[dd] vi[sual] viu[sage] vmapc[lear] vne[w] vs[plit] vu[nmap] wa[ll] wh[ile] winc[md] windo winp[os] win[size] wn[ext] wN[ext] wp[revious] wq wqa[ll] w[rite] ws[verb] wv[iminfo] X xa[ll] x[it] XMLent XMLns y[ank] 
+syn keyword vimCommand contained       ab[breviate] abc[lear] abo[veleft] al[l] arga[dd] argd[elete] argdo arge[dit] argg[lobal] argl[ocal] ar[gs] argu[ment] as[cii] bad[d] ba[ll] bd[elete] be bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bN[ext] bo[tright] bp[revious] brea[k] breaka[dd] breakd[el] breakl[ist] br[ewind] bro[wse] bufdo b[uffer] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] caddb[uffer] cad[dexpr] caddf[ile] cal[l] cat[ch] cb[uffer] cc ccl[ose] cd ce[nter] cex[pr] cf[ile] cfir[st] cg[etfile] c[hange] changes chd[ir] che[ckpath] checkt[ime] cla[st] cl[ist] clo[se] cmapc[lear] cnew[er] cn[ext] cN[ext] cnf[ile] cNf[ile] cnorea[bbrev] col[der] colo[rscheme] comc[lear] comp[iler] conf[irm] con[tinue] cope[n] co[py] cpf[ile] cp[revious] cq[uit] cr[ewind] cuna[bbrev] cu[nmap] cw[indow] debugg[reedy] delc[ommand] d[elete] DeleteFirst delf[unction] delm[arks] diffg[et] diffoff diffpatch diffpu[t] diffsplit diffthis diffu[pdate] dig[raphs] di[splay] dj[ump] dl[ist] dr[op] ds[earch] dsp[lit] echoe[rr] echom[sg] echon e[dit] el[se] elsei[f] em[enu] emenu* endfo[r] endf[unction] en[dif] endt[ry] endw[hile] ene[w] ex exi[t] Explore exu[sage] f[ile] files filetype fina[lly] fin[d] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] folddoc[losed] foldd[oopen] foldo[pen] for fu[nction] g[lobal] go[to] gr[ep] grepa[dd] ha[rdcopy] h[elp] helpf[ind] helpg[rep] helpt[ags] Hexplore hid[e] his[tory] I ia[bbrev] iabc[lear] if ij[ump] il[ist] imapc[lear] inorea[bbrev] is[earch] isp[lit] iuna[bbrev] iu[nmap] j[oin] ju[mps] k keepalt keepj[umps] kee[pmarks] laddb[uffer] lad[dexpr] laddf[ile] lan[guage] la[st] lb[uffer] lc[d] lch[dir] lcl[ose] le[ft] lefta[bove] lex[pr] lf[ile] lfir[st] lg[etfile] lgr[ep] lgrepa[dd] l[ist] ll lla[st] lli[st] lmak[e] lm[ap] lmapc[lear] lnew[er] lne[xt] lN[ext] lnf[ile] lNf[ile] ln[oremap] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lpf[ile] lp[revious] lr[ewind] ls lt[ag] lu[nmap] lv[imgrep] lvimgrepa[dd] lw[indow] mak[e] ma[rk] marks mat[ch] menut[ranslate] mk[exrc] mks[ession] mksp[ell] mkvie[w] mkv[imrc] mod[e] m[ove] mzf[ile] mz[scheme] nbkey NetrwSettings new n[ext] N[ext] nmapc[lear] noh[lsearch] norea[bbrev] Nread nu[mber] nun[map] Nw omapc[lear] on[ly] o[pen] opt[ions] ou[nmap] pc[lose] ped[it] pe[rl] perld[o] po[p] popu popu[p] pp[op] pre[serve] prev[ious] p[rint] P[rint] profd[el] prof[ile] prompt promptf[ind] promptr[epl] ps[earch] pta[g] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptN[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] pyf[ile] py[thon] qa[ll] q[uit] quita[ll] r[ead] rec[over] redi[r] red[o] redr[aw] redraws[tatus] reg[isters] res[ize] ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] rub[y] rubyd[o] rubyf[ile] ru[ntime] rv[iminfo] sal[l] san[dbox] sa[rgument] sav[eas] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbN[ext] sbp[revious] sbr[ewind] sb[uffer] scripte[ncoding] scrip[tnames] se[t] setf[iletype] setg[lobal] setl[ocal] Sexplore sf[ind] sfir[st] sh[ell] sign sil[ent] sim[alt] sla[st] sl[eep] sm[agic] sn[ext] sN[ext] sni[ff] sno[magic] sor[t] so[urce] spelld[ump] spe[llgood] spellr[epall] spellw[rong] sp[lit] spr[evious] sre[wind] sta[g] startg[replace] star[tinsert] startr[eplace] stj[ump] st[op] stopi[nsert] sts[elect] sun[hide] sus[pend] sv[iew] syncbind t ta[g] tags tc[l] tcld[o] tclf[ile] te[aroff] tf[irst] the th[row] tj[ump] tl[ast] tm tm[enu] tn[ext] tN[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] tu tu[nmenu] una[bbreviate] u[ndo] unh[ide] unlo[ckvar] unm[ap] up[date] verb[ose] ve[rsion] vert[ical] Vexplore v[global] vie[w] vim[grep] vimgrepa[dd] vi[sual] viu[sage] vmapc[lear] vne[w] vs[plit] vu[nmap] wa[ll] wh[ile] winc[md] windo winp[os] win[size] wn[ext] wN[ext] wp[revious] wq wqa[ll] w[rite] ws[verb] wv[iminfo] X xa[ll] x[it] XMLent XMLns y[ank] 
 syn match   vimCommand contained       "\<z[-+^.=]"
 
 " vimOptions are caught only when contained in a vimSet {{{2
@@ -44,7 +44,7 @@ syn keyword vimErrSetting contained   hardtabs ht w1200 w300 w9600
 
 " AutoBuf Events {{{2
 syn case ignore
-syn keyword vimAutoEvent contained     BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdwinEnter CmdwinLeave ColorScheme CursorHold E135 E143 E200 E201 E203 E204 EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter InsertChange InsertEnter InsertLeave MenuPopup QuickFixCmdPost QuickFixCmdPre RemoteReply SessionLoadPost StdinReadPost StdinReadPre SwapExists Syntax TermChanged TermResponse User UserGettingBored VimEnter VimLeave VimLeavePre WinEnter WinLeave 
+syn keyword vimAutoEvent contained     BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdwinEnter CmdwinLeave ColorScheme CursorHold E135 E143 E200 E201 E203 E204 EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter InsertChange InsertEnter InsertLeave MenuPopup QuickFixCmdPost QuickFixCmdPre RemoteReply SessionLoadPost SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TermChanged TermResponse User UserGettingBored VimEnter VimLeave VimLeavePre WinEnter WinLeave 
 
 " Highlight commonly used Groupnames {{{2
 syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo 
@@ -126,7 +126,7 @@ syn keyword vimPattern   contained  start   skip    end
 syn cluster vimOperGroup       contains=vimOper,vimOperParen,vimNumber,vimString,vimOperOk,vimRegister,vimContinue
 syn match  vimOper     "\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}"       skipwhite nextgroup=vimString,vimSpecFile
 syn match  vimOper     "||\|&&\|[-+.]" skipwhite nextgroup=vimString,vimSpecFile
-syn region vimOperParen oneline        matchgroup=vimOper start="(" end=")" contains=@vimOperGroup
+syn region vimOperParen        matchgroup=vimOper start="(" end=")" contains=@vimOperGroup
 syn region vimOperParen        matchgroup=vimSep  start="{" end="}" contains=@vimOperGroup nextgroup=vimVar
 syn match  vimOperOk   "\<[aiAIrR][()]"
 if !exists("g:vimsyntax_noerror")
@@ -185,7 +185,6 @@ syn match vimEnvvar "\${\I\i*}"
 " In-String Specials: {{{2
 " Try to catch strings, if nothing else matches (therefore it must precede the others!)
 "  vimEscapeBrace handles ["]  []"] (ie. "s don't terminate string inside [])
-"  COMBAK: I don't know why the \ze is needed in vimPatSepZone
 syn region vimEscapeBrace      oneline   contained transparent start="[^\\]\(\\\\\)*\[\^\=\]\=" skip="\\\\\|\\\]" end="\]"me=e-1
 syn match  vimPatSepErr        contained       "\\)"
 syn match  vimPatSep   contained       "\\|"
@@ -194,7 +193,7 @@ syn region vimPatRegion     contained transparent matchgroup=vimPatSepR start="\\[z%
 syn match  vimNotPatSep        contained       "\\\\"
 syn cluster vimStringGroup     contains=vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone
 syn region vimString   oneline keepend start=+[^:a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ end=+"+   contains=@vimStringGroup
-syn region vimString   oneline keepend start=+[^:a-zA-Z>!\\@]'+lc=1 end=+'+    contains=@vimStringGroup
+syn region vimString   oneline keepend start=+[^:a-zA-Z>!\\@]'+lc=1 end=+'+
 syn region vimString   oneline start=+=!+lc=1  skip=+\\\\\|\\!+ end=+!+        contains=@vimStringGroup
 syn region vimString   oneline start="=+"lc=1  skip="\\\\\|\\+" end="+"        contains=@vimStringGroup
 syn region vimString   oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/"   contains=@vimStringGroup
@@ -221,7 +220,7 @@ syn match   vimSubstFlagErr contained       "[^< \t\r|]\+" contains=vimSubstFlags
 syn match   vimSubstFlags   contained  "[&cegiIpr]\+"
 
 " 'String': {{{2
-syn match  vimString   "[^(,]'[^']\{-}'"lc=1   contains=@vimStringGroup
+syn match  vimString   "[^(,]'[^']\{-}\zs'"
 
 " Marks, Registers, Addresses, Filters: {{{2
 syn match  vimMark     "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimOper,vimMarkNumber,vimSubst
@@ -249,8 +248,8 @@ syn match  vimFilter contained      "\A!.\{-}\(|\|$\)"ms=s+1        contains=vimSpecFile
 "syn match  vimCmplxRepeat     '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\)'
 
 " Set command and associated set-options (vimOptions) with comment {{{2
-syn region vimSet              matchgroup=vimCommand start="\<setlocal\|set\>" end="|"me=e-1 end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vimSetString,vimSetMod
-syn region vimSetEqual  contained      start="="       skip="\\\\\|\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation
+syn region vimSet              matchgroup=vimCommand start="\<setlocal\|set\>" skip="\%(\\\\\)*\\." end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend oneline contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vimSetString,vimSetMod
+syn region vimSetEqual  contained      start="="       skip="\\\\\|\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation oneline
 syn region vimSetString contained      start=+="+hs=s+1        skip=+\\\\\|\\"+  end=+"+       contains=vimCtrlChar
 syn match  vimSetSep    contained      "[,:]"
 syn match  vimSetMod   contained       "&vim\|[!&]\|all&"
index f373806ec8ab74683d35db672ea9b89b171a5c41..ca94386ce512f6058fe904d727ee721d5295694e 100644 (file)
@@ -675,6 +675,8 @@ LINK_PDB = /PDB:$(OUTDIR)/$(VIM).pdb -debug:full -debugtype:cv,fixup
 
 conflags = /nologo /subsystem:$(SUBSYSTEM) /incremental:no
 
+PATHDEF_SRC = $(OUTDIR)\pathdef.c
+
 !IF "$(MAP)" == "yes"
 # "/map" is for debugging
 conflags = $(conflags) /map
@@ -736,7 +738,6 @@ notags:
 
 clean:
        - if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
-       - if exist auto/pathdef.c del auto/pathdef.c
        - if exist *.obj del *.obj
        - if exist $(VIM).exe del $(VIM).exe
        - if exist $(VIM).ilk del $(VIM).ilk
@@ -894,8 +895,8 @@ $(OUTDIR)/os_win32.obj:     $(OUTDIR) os_win32.c  $(INCL) os_win32.h
 
 $(OUTDIR)/os_w32exe.obj:       $(OUTDIR) os_w32exe.c  $(INCL)
 
-$(OUTDIR)/pathdef.obj: $(OUTDIR) auto/pathdef.c  $(INCL)
-       $(CC) $(CFLAGS) auto/pathdef.c
+$(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
+       $(CC) $(CFLAGS) $(PATHDEF_SRC)
 
 $(OUTDIR)/popupmenu.obj:       $(OUTDIR) popupmenu.c  $(INCL)
 
@@ -943,16 +944,16 @@ $(OUTDIR)/glbl_ime.obj:   $(OUTDIR) glbl_ime.cpp  dimm.h $(INCL)
 E0_CFLAGS = $(CFLAGS:\=\\)
 E_CFLAGS = $(E0_CFLAGS:"=\")
 
-auto/pathdef.c: auto
-       @echo creating auto/pathdef.c
-       @echo /* pathdef.c */ > auto\pathdef.c
-       @echo #include "vim.h" >> auto\pathdef.c
-       @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> auto\pathdef.c
-       @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> auto\pathdef.c
-       @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> auto\pathdef.c
-       @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> auto\pathdef.c
-       @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> auto\pathdef.c
-       @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> auto\pathdef.c
+$(PATHDEF_SRC): auto
+       @echo creating $(PATHDEF_SRC)
+       @echo /* pathdef.c */ > $(PATHDEF_SRC)
+       @echo #include "vim.h" >> $(PATHDEF_SRC)
+       @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC)
+       @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC)
+       @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC)
+       @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> $(PATHDEF_SRC)
+       @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
+       @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
 
 auto:
        if not exist auto/nul mkdir auto
index ee574ad6c9ccbaa6c56e26b9522f087e15e09572..c59d08fc54db53d4f01a7482dcbd2d269db23399 100644 (file)
@@ -68,7 +68,11 @@ struct Completion
     compl_T    *cp_next;
     compl_T    *cp_prev;
     char_u     *cp_str;        /* matched text */
-    char_u     *cp_fname;      /* file containing the match */
+    char_u     *cp_extra;      /* extra menu text (allocated, can be NULL) */
+    char_u     *cp_info;       /* verbose info (can be NULL) */
+    char_u     cp_kind;        /* kind of match, single letter, or NUL */
+    char_u     *cp_fname;      /* file containing the match, allocated when
+                                * cp_flags has FREE_FNAME */
     int                cp_flags;       /* ORIGINAL_TEXT, CONT_S_IPOS or FREE_FNAME */
     int                cp_number;      /* sequence number */
 };
@@ -115,20 +119,21 @@ static expand_T     compl_xp;
 
 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 void ins_compl_add_matches __ARGS((int num_matches, char_u **matches));
 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 int  pum_two_or_more __ARGS((void));
-static void ins_compl_dictionaries __ARGS((char_u *dict, char_u *pat, int dir, int flags, int thesaurus));
+static void ins_compl_dictionaries __ARGS((char_u *dict, char_u *pat, int flags, int thesaurus));
 static void ins_compl_free __ARGS((void));
 static void ins_compl_clear __ARGS((void));
 static int  ins_compl_bs __ARGS((void));
 static void ins_compl_addleader __ARGS((int c));
+static void ins_compl_addfrommatch __ARGS((void));
 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 int  ins_compl_get_exp __ARGS((pos_T *ini));
 static void ins_compl_delete __ARGS((void));
 static void ins_compl_insert __ARGS((void));
 static int  ins_compl_next __ARGS((int allow_get_expansion, int count));
@@ -684,19 +689,34 @@ edit(cmdchar, startln, count)
        if (c == K_DOWN && pum_visible())
            c = Ctrl_N;
 
-       /* When using BS while the popup menu is wanted and still after the
-        * character where completion started: Change the subset of matches to
-        * what matches "compl_leader". */
-       if (compl_started && pum_wanted() && curwin->w_cursor.col > compl_col)
+       /*
+        * Special handling of keys while the popup menu is visible or wanted
+        * and the cursor is still in the completed word.
+        */
+       if (compl_started && pum_wanted() && curwin->w_cursor.col >= compl_col)
        {
-           if ((c == K_BS || c == Ctrl_H) && ins_compl_bs())
+           /* BS: Delete one character from "compl_leader". */
+           if ((c == K_BS || c == Ctrl_H)
+                       && curwin->w_cursor.col > compl_col && ins_compl_bs())
                continue;
 
-           /* Editing the word. */
-           if (!compl_used_match && vim_isprintc(c))
+           /* When no match was selected or it was edited. */
+           if (!compl_used_match)
            {
-               ins_compl_addleader(c);
-               continue;
+               /* CTRL-L: Add one character from the current match to
+                * "compl_leader". */
+               if (c == Ctrl_L)
+               {
+                   ins_compl_addfrommatch();
+                   continue;
+               }
+
+               /* A printable character: Add it to "compl_leader". */
+               if (vim_isprintc(c))
+               {
+                   ins_compl_addleader(c);
+                   continue;
+               }
            }
        }
 
@@ -1922,7 +1942,7 @@ vim_is_ctrl_x_key(c)
 }
 
 /*
- * This is like ins_compl_add(), but if ic and inf are set, then the
+ * This is like ins_compl_add(), but if 'ic' and 'inf' are set, then the
  * case of the originally typed text is used, and the case of the completed
  * text is infered, ie this tries to work out what case you probably wanted
  * the rest of the word to be in -- webb
@@ -1985,9 +2005,9 @@ ins_compl_add_infercase(str, len, fname, dir, flags)
        /* Copy the original case of the part we typed */
        STRNCPY(IObuff, compl_orig_text, compl_length);
 
-       return ins_compl_add(IObuff, len, fname, dir, flags);
+       return ins_compl_add(IObuff, len, fname, NULL, dir, flags);
     }
-    return ins_compl_add(str, len, fname, dir, flags);
+    return ins_compl_add(str, len, fname, NULL, dir, flags);
 }
 
 /*
@@ -2002,14 +2022,16 @@ ins_compl_add_infercase(str, len, fname, dir, flags)
  * maybe because alloc() returns NULL, then FAIL is returned -- webb.
  */
     int
-ins_compl_add(str, len, fname, dir, flags)
+ins_compl_add(str, len, fname, extra, cdir, flags)
     char_u     *str;
     int                len;
     char_u     *fname;
-    int                dir;
+    char_u     *extra;     /* extra text for popup menu or NULL */
+    int                cdir;
     int                flags;
 {
     compl_T    *match;
+    int                dir = (cdir == 0 ? compl_direction : cdir);
 
     ui_breakcheck();
     if (got_int)
@@ -2040,7 +2062,7 @@ ins_compl_add(str, len, fname, dir, flags)
      * Allocate a new match structure.
      * Copy the values to the new match structure.
      */
-    match = (compl_T *)alloc((unsigned)sizeof(compl_T));
+    match = (compl_T *)alloc_clear((unsigned)sizeof(compl_T));
     if (match == NULL)
        return FAIL;
     match->cp_number = -1;
@@ -2054,18 +2076,26 @@ ins_compl_add(str, len, fname, dir, flags)
        vim_free(match);
        return FAIL;
     }
+
     /* match-fname is:
      * - compl_curr_match->cp_fname if it is a string equal to fname.
      * - a copy of fname, FREE_FNAME is set to free later THE allocated mem.
      * - NULL otherwise.       --Acevedo */
-    if (fname && compl_curr_match && compl_curr_match->cp_fname
-             && STRCMP(fname, compl_curr_match->cp_fname) == 0)
+    if (fname != NULL
+           && compl_curr_match
+           && compl_curr_match->cp_fname != NULL
+           && STRCMP(fname, compl_curr_match->cp_fname) == 0)
        match->cp_fname = compl_curr_match->cp_fname;
-    else if (fname && (match->cp_fname = vim_strsave(fname)) != NULL)
+    else if (fname != NULL)
+    {
+       match->cp_fname = vim_strsave(fname);
        flags |= FREE_FNAME;
+    }
     else
        match->cp_fname = NULL;
     match->cp_flags = flags;
+    if (extra != NULL)
+       match->cp_extra = vim_strsave(extra);
 
     /*
      * Link the new match structure in the list of matches.
@@ -2098,19 +2128,18 @@ ins_compl_add(str, len, fname, dir, flags)
  * Frees matches[].
  */
     static void
-ins_compl_add_matches(num_matches, matches, dir)
+ins_compl_add_matches(num_matches, matches)
     int                num_matches;
     char_u     **matches;
-    int                dir;
 {
     int                i;
     int                add_r = OK;
-    int                ldir = dir;
+    int                dir = compl_direction;
 
     for (i = 0; i < num_matches && add_r != FAIL; i++)
-       if ((add_r = ins_compl_add(matches[i], -1, NULL, ldir, 0)) == OK)
+       if ((add_r = ins_compl_add(matches[i], -1, NULL, NULL, dir, 0)) == OK)
            /* if dir was BACKWARD then honor it just once */
-           ldir = FORWARD;
+           dir = FORWARD;
     FreeWild(num_matches, matches);
 }
 
@@ -2143,7 +2172,7 @@ ins_compl_make_cyclic()
 
 /* "compl_match_array" points the currently displayed list of entries in the
  * popup menu.  It is NULL when there is no popup menu. */
-static char_u **compl_match_array = NULL;
+static pumitem_T *compl_match_array = NULL;
 static int compl_match_arraysize;
 
 /*
@@ -2223,11 +2252,15 @@ pum_two_or_more()
 
 /*
  * Show the popup menu for the list of matches.
+ * Also adjusts "compl_shown_match" to an entry that is actually displayed.
  */
     void
 ins_compl_show_pum()
 {
     compl_T     *compl;
+    compl_T     *shown_compl = NULL;
+    int                did_find_shown_match = FALSE;
+    int                shown_match_ok = FALSE;
     int                i;
     int                cur = -1;
     colnr_T    col;
@@ -2256,7 +2289,8 @@ ins_compl_show_pum()
        } while (compl != NULL && compl != compl_first_match);
        if (compl_match_arraysize == 0)
            return;
-       compl_match_array = (char_u **)alloc((unsigned)(sizeof(char_u **)
+       compl_match_array = (pumitem_T *)alloc_clear(
+                                   (unsigned)(sizeof(pumitem_T)
                                                    * compl_match_arraysize));
        if (compl_match_array != NULL)
        {
@@ -2269,19 +2303,52 @@ ins_compl_show_pum()
                            || STRNCMP(compl->cp_str, compl_leader,
                                                              lead_len) == 0))
                {
-                   if (compl == compl_shown_match)
+                   if (!shown_match_ok)
+                   {
+                       if (compl == compl_shown_match || did_find_shown_match)
+                       {
+                           /* This item is the shown match or this is the
+                            * first displayed item after the shown match. */
+                           compl_shown_match = compl;
+                           did_find_shown_match = TRUE;
+                           shown_match_ok = TRUE;
+                       }
+                       else
+                           /* Remember this displayed match for when the
+                            * shown match is just below it. */
+                           shown_compl = compl;
                        cur = i;
-                   compl_match_array[i++] = compl->cp_str;
+                   }
+                   compl_match_array[i].pum_text = compl->cp_str;
+                   if (compl->cp_extra != NULL)
+                       compl_match_array[i++].pum_extra = compl->cp_extra;
+                   else
+                       compl_match_array[i++].pum_extra = compl->cp_fname;
+               }
+
+               if (compl == compl_shown_match)
+               {
+                   did_find_shown_match = TRUE;
+                   if (!shown_match_ok && shown_compl != NULL)
+                   {
+                       /* The shown match isn't displayed, set it to the
+                        * previously displayed match. */
+                       compl_shown_match = shown_compl;
+                       shown_match_ok = TRUE;
+                   }
                }
                compl = compl->cp_next;
            } while (compl != NULL && compl != compl_first_match);
+
+           if (!shown_match_ok)    /* no displayed match at all */
+               cur = -1;
        }
     }
     else
     {
        /* popup menu already exists, only need to find the current item.*/
        for (i = 0; i < compl_match_arraysize; ++i)
-           if (compl_match_array[i] == compl_shown_match->cp_str)
+           if (compl_match_array[i].pum_text == compl_shown_match->cp_str)
                break;
        cur = i;
     }
@@ -2309,10 +2376,9 @@ ins_compl_show_pum()
  * completions.
  */
     static void
-ins_compl_dictionaries(dict, pat, dir, flags, thesaurus)
+ins_compl_dictionaries(dict, pat, flags, thesaurus)
     char_u     *dict;
     char_u     *pat;
-    int                dir;
     int                flags;
     int                thesaurus;
 {
@@ -2325,6 +2391,7 @@ ins_compl_dictionaries(dict, pat, dir, flags, thesaurus)
     int                count;
     int                i;
     int                save_p_scs;
+    int                dir = compl_direction;
 
     buf = alloc(LSIZE);
     /* If 'infercase' is set, don't use 'smartcase' here */
@@ -2521,6 +2588,7 @@ ins_compl_free()
        /* several entries may use the same fname, free it just once. */
        if (match->cp_flags & FREE_FNAME)
            vim_free(match->cp_fname);
+       vim_free(match->cp_extra);
        vim_free(match);
     } while (compl_curr_match != NULL && compl_curr_match != compl_first_match);
     compl_first_match = compl_curr_match = NULL;
@@ -2541,8 +2609,8 @@ ins_compl_clear()
 }
 
 /*
- * Delete one character before the cursor and make a subset of the matches
- * that match now.
+ * Delete one character before the cursor and show the subset of the matches
+ * that match the word that is now before the cursor.
  * Returns TRUE if the work is done and another char to be got from the user.
  */
     static int
@@ -2629,6 +2697,29 @@ ins_compl_addleader(c)
     }
 }
 
+/*
+ * Append one character to the match leader.  May reduce the number of
+ * matches.
+ */
+    static void
+ins_compl_addfrommatch()
+{
+    char_u     *p;
+    int                len = curwin->w_cursor.col - compl_col;
+    int                c;
+
+    p = compl_shown_match->cp_str;
+    if (STRLEN(p) <= len)   /* the match is too short */
+       return;
+    p += len;
+#ifdef FEAT_MBYTE
+    c = mb_ptr2char(p);
+#else
+    c = *p;
+#endif
+    ins_compl_addleader(c);
+}
+
 /*
  * Prepare for Insert mode completion, or stop it.
  * Called just after typing a character in Insert mode.
@@ -2919,30 +3010,30 @@ ins_compl_next_buf(buf, flag)
 }
 
 #ifdef FEAT_COMPL_FUNC
-static int expand_by_function __ARGS((int type, char_u *base, char_u ***matches));
+static void expand_by_function __ARGS((int type, char_u *base));
 
 /*
  * Execute user defined complete function 'completefunc' or 'omnifunc', and
  * get matches in "matches".
  * Return value is number of matches.
  */
-    static int
-expand_by_function(type, base, matches)
+    static void
+expand_by_function(type, base)
     int                type;       /* CTRL_X_OMNI or CTRL_X_FUNCTION */
     char_u     *base;
-    char_u     ***matches;
 {
     list_T      *matchlist;
     char_u     *args[2];
     listitem_T *li;
-    garray_T    ga;
     char_u     *p;
     char_u     *funcname;
     pos_T      pos;
+    int                dir = compl_direction;
+    char_u     *x;
 
     funcname = (type == CTRL_X_FUNCTION) ? curbuf->b_p_cfu : curbuf->b_p_ofu;
     if (*funcname == NUL)
-       return 0;
+       return;
 
     /* Call 'completefunc' to obtain the list of matches. */
     args[0] = (char_u *)"0";
@@ -2952,42 +3043,47 @@ expand_by_function(type, base, matches)
     matchlist = call_func_retlist(funcname, 2, args, FALSE);
     curwin->w_cursor = pos;    /* restore the cursor position */
     if (matchlist == NULL)
-       return 0;
+       return;
 
-    /* Go through the List with matches and put them in an array. */
-    ga_init2(&ga, (int)sizeof(char_u *), 8);
+    /* Go through the List with matches and add each of them. */
     for (li = matchlist->lv_first; li != NULL; li = li->li_next)
     {
-       p = get_tv_string_chk(&li->li_tv);
+       if (li->li_tv.v_type == VAR_DICT && li->li_tv.vval.v_dict != NULL)
+       {
+           p = get_dict_string(li->li_tv.vval.v_dict, (char_u *)"word", FALSE);
+           x = get_dict_string(li->li_tv.vval.v_dict, (char_u *)"menu", FALSE);
+       }
+       else
+       {
+           p = get_tv_string_chk(&li->li_tv);
+           x = NULL;
+       }
        if (p != NULL && *p != NUL)
        {
-           if (ga_grow(&ga, 1) == FAIL)
-               break;
-           ((char_u **)ga.ga_data)[ga.ga_len] = vim_strsave(p);
-           ++ga.ga_len;
+           if (ins_compl_add(p, -1, NULL, x, dir, 0) == OK)
+               /* if dir was BACKWARD then honor it just once */
+               dir = FORWARD;
        }
        else if (did_emsg)
            break;
     }
 
     list_unref(matchlist);
-    *matches = (char_u **)ga.ga_data;
-    return ga.ga_len;
 }
 #endif /* FEAT_COMPL_FUNC */
 
 /*
  * Get the next expansion(s), using "compl_pattern".
- * The search starts at position "ini" in curbuf and in the direction dir.
+ * The search starts at position "ini" in curbuf and in the direction
+ * compl_direction.
  * When "compl_started" is FALSE start at that position, otherwise
  * continue where we stopped searching before.
  * This may return before finding all the matches.
  * Return the total number of matches or -1 if still unknown -- Acevedo
  */
     static int
-ins_compl_get_exp(ini, dir)
+ins_compl_get_exp(ini)
     pos_T      *ini;
-    int                dir;
 {
     static pos_T       first_match_pos;
     static pos_T       last_match_pos;
@@ -3023,7 +3119,7 @@ ins_compl_get_exp(ini, dir)
     }
 
     old_match = compl_curr_match;      /* remember the last current match */
-    pos = (dir == FORWARD) ? &last_match_pos : &first_match_pos;
+    pos = (compl_direction == FORWARD) ? &last_match_pos : &first_match_pos;
     /* For ^N/^P loop over all the flags/windows/buffers in 'complete' */
     for (;;)
     {
@@ -3126,7 +3222,7 @@ ins_compl_get_exp(ini, dir)
 #ifdef FEAT_FIND_ID
        case CTRL_X_PATH_PATTERNS:
        case CTRL_X_PATH_DEFINES:
-           find_pattern_in_path(compl_pattern, dir,
+           find_pattern_in_path(compl_pattern, compl_direction,
                                 (int)STRLEN(compl_pattern), FALSE, FALSE,
                                 (type == CTRL_X_PATH_DEFINES
                                  && !(compl_cont_status & CONT_SOL))
@@ -3146,7 +3242,7 @@ ins_compl_get_exp(ini, dir)
                             : (*curbuf->b_p_dict == NUL
                                 ? p_dict
                                 : curbuf->b_p_dict)),
-                           compl_pattern, dir,
+                           compl_pattern,
                                 dict ? dict_f : 0, type == CTRL_X_THESAURUS);
            dict = NULL;
            break;
@@ -3163,7 +3259,7 @@ ins_compl_get_exp(ini, dir)
                    TAG_INS_COMP | (ctrl_x_mode ? TAG_VERBOSE : 0),
                    TAG_MANY, curbuf->b_ffname) == OK && num_matches > 0)
            {
-               ins_compl_add_matches(num_matches, matches, dir);
+               ins_compl_add_matches(num_matches, matches);
            }
            p_ic = save_p_ic;
            break;
@@ -3175,7 +3271,7 @@ ins_compl_get_exp(ini, dir)
 
                /* May change home directory back to "~". */
                tilde_replace(compl_pattern, num_matches, matches);
-               ins_compl_add_matches(num_matches, matches, dir);
+               ins_compl_add_matches(num_matches, matches);
            }
            break;
 
@@ -3183,15 +3279,13 @@ ins_compl_get_exp(ini, dir)
            if (expand_cmdline(&compl_xp, compl_pattern,
                        (int)STRLEN(compl_pattern),
                                         &num_matches, &matches) == EXPAND_OK)
-               ins_compl_add_matches(num_matches, matches, dir);
+               ins_compl_add_matches(num_matches, matches);
            break;
 
 #ifdef FEAT_COMPL_FUNC
        case CTRL_X_FUNCTION:
        case CTRL_X_OMNI:
-           num_matches = expand_by_function(type, compl_pattern, &matches);
-           if (num_matches > 0)
-               ins_compl_add_matches(num_matches, matches, dir);
+           expand_by_function(type, compl_pattern);
            break;
 #endif
 
@@ -3200,7 +3294,7 @@ ins_compl_get_exp(ini, dir)
            num_matches = expand_spelling(first_match_pos.lnum,
                                 first_match_pos.col, compl_pattern, &matches);
            if (num_matches > 0)
-               ins_compl_add_matches(num_matches, matches, dir);
+               ins_compl_add_matches(num_matches, matches);
 #endif
            break;
 
@@ -3230,9 +3324,10 @@ ins_compl_get_exp(ini, dir)
                if (    ctrl_x_mode == CTRL_X_WHOLE_LINE
                        || (compl_cont_status & CONT_SOL))
                    found_new_match = search_for_exact_line(ins_buf, pos,
-                                                           dir, compl_pattern);
+                                             compl_direction, compl_pattern);
                else
-                   found_new_match = searchit(NULL, ins_buf, pos, dir,
+                   found_new_match = searchit(NULL, ins_buf, pos,
+                                                             compl_direction,
                                 compl_pattern, 1L, SEARCH_KEEP + SEARCH_NFMSG,
                                                                     RE_LAST);
                if (!compl_started)
@@ -3335,7 +3430,7 @@ ins_compl_get_exp(ini, dir)
                }
                if (ins_compl_add_infercase(ptr, len,
                                 ins_buf == curbuf ? NULL : ins_buf->b_sfname,
-                                                      dir, flags) != NOTDONE)
+                                          0, flags) != NOTDONE)
                {
                    found_new_match = OK;
                    break;
@@ -3388,7 +3483,7 @@ ins_compl_get_exp(ini, dir)
     /* If several matches were added (FORWARD) or the search failed and has
      * just been made cyclic then we have to move compl_curr_match to the next
      * or previous entry (if any) -- Acevedo */
-    compl_curr_match = dir == FORWARD ? old_match->cp_next : old_match->cp_prev;
+    compl_curr_match = compl_direction == FORWARD ? old_match->cp_next : old_match->cp_prev;
     if (compl_curr_match == NULL)
        compl_curr_match = old_match;
     return i;
@@ -3476,7 +3571,7 @@ ins_compl_next(allow_get_expansion, count)
            if (!allow_get_expansion)
                return -1;
 
-           num_matches = ins_compl_get_exp(&compl_startpos, compl_direction);
+           num_matches = ins_compl_get_exp(&compl_startpos);
            if (compl_pending && compl_direction == compl_shows_dir)
                compl_shown_match = compl_curr_match;
            found_end = FALSE;
@@ -3992,7 +4087,7 @@ ins_complete(c)
         * when the list of matches is freed. */
        compl_orig_text = vim_strnsave(line + compl_col, compl_length);
        if (compl_orig_text == NULL || ins_compl_add(compl_orig_text,
-                                           -1, NULL, 0, ORIGINAL_TEXT) != OK)
+                                     -1, NULL, NULL, 0, ORIGINAL_TEXT) != OK)
        {
            vim_free(compl_pattern);
            compl_pattern = NULL;
index c44aae048930c40802c42ae06588e5e70c58dc30..3044ef8927584db443689e998333926d615d471e 100644 (file)
@@ -6342,20 +6342,26 @@ dict_find(d, key, len)
 }
 
 /*
- * Get a string item from a dictionary in allocated memory.
+ * Get a string item from a dictionary.
+ * When "save" is TRUE allocate memory for it.
  * Returns NULL if the entry doesn't exist or out of memory.
  */
     char_u *
-get_dict_string(d, key)
+get_dict_string(d, key, save)
     dict_T     *d;
     char_u     *key;
+    int                save;
 {
     dictitem_T *di;
+    char_u     *s;
 
     di = dict_find(d, key, -1);
     if (di == NULL)
        return NULL;
-    return vim_strsave(get_tv_string(&di->di_tv));
+    s = get_tv_string(&di->di_tv);
+    if (save && s != NULL)
+       s = vim_strsave(s);
+    return s;
 }
 
 /*
@@ -8014,11 +8020,20 @@ f_complete_add(argvars, rettv)
     typval_T   *argvars;
     typval_T   *rettv;
 {
-    char_u     *s;
+    char_u     *word;
+    char_u     *extra = NULL;
 
-    s = get_tv_string_chk(&argvars[0]);
-    if (s != NULL)
-       rettv->vval.v_number = ins_compl_add(s, -1, NULL, FORWARD, 0);
+    if (argvars[0].v_type == VAR_DICT && argvars[0].vval.v_dict != NULL)
+    {
+       word = get_dict_string(argvars[0].vval.v_dict,
+                                                    (char_u *)"word", FALSE);
+       extra = get_dict_string(argvars[0].vval.v_dict,
+                                                    (char_u *)"menu", FALSE);
+    }
+    else
+       word = get_tv_string_chk(&argvars[0]);
+    if (word != NULL)
+       rettv->vval.v_number = ins_compl_add(word, -1, NULL, extra, 0, 0);
 }
 
 /*
index 488c6de0d16890a5b4d6989e604cc3405d749f97..a5b0552721fe3156e9c9ac9ff4c0cbe5c8052bd0 100644 (file)
@@ -515,6 +515,8 @@ EX(CMD_lgrep,               "lgrep",        ex_make,
                        BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
 EX(CMD_lgrepadd,       "lgrepadd",     ex_make,
                        BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+EX(CMD_lhelpgrep,      "lhelpgrep",    ex_helpgrep,
+                       EXTRA|NOTRLCOM|NEEDARG),
 EX(CMD_ll,             "ll",           ex_cc,
                        RANGE|NOTADR|COUNT|TRLBAR|BANG),
 EX(CMD_llast,          "llast",        ex_cc,
index 78107bf65983a254b7160dd1070fab9d2378fa61..a2c57fc984ccd47672755a9abf6a551eab1ad4e4 100644 (file)
@@ -75,6 +75,7 @@ static int getConnInfo __ARGS((char *file, char **host, char **port, char **pass
 
 static void nb_init_graphics __ARGS((void));
 static void coloncmd __ARGS((char *cmd, ...));
+static void nb_set_curbuf __ARGS((buf_T *buf));
 #ifdef FEAT_GUI_MOTIF
 static void messageFromNetbeans __ARGS((XtPointer, int *, XtInputId *));
 #endif
@@ -1365,8 +1366,7 @@ nb_do_cmd(
                netbeansFireChanges = FALSE;
                netbeansSuppressNoLines = TRUE;
 
-               if (curbuf != buf->bufp)
-                   set_curbuf(buf->bufp, DOBUF_GOTO);
+               nb_set_curbuf(buf->bufp);
                wasChanged = buf->bufp->b_changed;
                cp = (char *)args;
                off = strtol(cp, &cp, 10);
@@ -1488,8 +1488,7 @@ nb_do_cmd(
                netbeansFireChanges = 0;
                lbuf[0] = '\0';
 
-               if (curbuf != buf->bufp)
-                   set_curbuf(buf->bufp, DOBUF_GOTO);
+               nb_set_curbuf(buf->bufp);
                old_b_changed = buf->bufp->b_changed;
 
                pos = off2pos(buf->bufp, off);
@@ -1694,8 +1693,7 @@ nb_do_cmd(
            }
            doupdate = 1;
            buf->initDone = TRUE;
-           if (curbuf != buf->bufp)
-               set_curbuf(buf->bufp, DOBUF_GOTO);
+           nb_set_curbuf(buf->bufp);
 #if defined(FEAT_AUTOCMD)
            apply_autocmds(EVENT_BUFREADPOST, 0, 0, FALSE, buf->bufp);
 #endif
@@ -1891,8 +1889,8 @@ nb_do_cmd(
                return FAIL;
            }
 
-           if (curbuf != buf->bufp)
-               set_curbuf(buf->bufp, DOBUF_GOTO);
+           nb_set_curbuf(buf->bufp);
+
 #ifdef FEAT_VISUAL
            /* Don't want Visual mode now. */
            if (VIsual_active)
@@ -2140,8 +2138,7 @@ nb_do_cmd(
                nbdebug(("    null bufp in %s command", cmd));
                return FAIL;
            }
-           if (curbuf != buf->bufp)
-               set_curbuf(buf->bufp, DOBUF_GOTO);
+           nb_set_curbuf(buf->bufp);
            cp = (char *)args;
            off = strtol(cp, &cp, 10);
            len = strtol(cp, NULL, 10);
@@ -2314,6 +2311,19 @@ nb_do_cmd(
 }
 
 
+/*
+ * If "buf" is not the current buffer try changing to a window that edits this
+ * buffer.  If there is no such window then close the current buffer and set
+ * the current buffer as "buf".
+ */
+    static void
+nb_set_curbuf(buf)
+    buf_T *buf;
+{
+    if (curbuf != buf && buf_jump_open_win(buf) == NULL)
+       set_curbuf(buf, DOBUF_GOTO);
+}
+
 /*
  * Process a vim colon command.
  */
index 7024e5556031b57461e4ec1b36aa96af50418e12..9d11a45703672d3fb27a4496ccb9b83e08919158 100644 (file)
 
 #if defined(FEAT_INS_EXPAND) || defined(PROTO)
 
-static char_u **pum_array = NULL;      /* items of displayed pum */
+static pumitem_T *pum_array = NULL;    /* items of displayed pum */
 static int pum_size;                   /* nr of items in "pum_array" */
 static int pum_selected;               /* index of selected item or -1 */
 static int pum_first = 0;              /* index of top item */
 
 static int pum_height;                 /* nr of displayed pum items */
 static int pum_width;                  /* width of displayed pum items */
+static int pum_base_width;             /* width of pum items base */
 static int pum_scrollbar;              /* TRUE when scrollbar present */
 
 static int pum_row;                    /* top row of pum */
@@ -37,7 +38,7 @@ static int pum_col;                   /* left column of pum */
  */
     void
 pum_display(array, size, selected, row, height, col)
-    char_u     **array;
+    pumitem_T  *array;
     int                size;
     int                selected;       /* index of initially selected item */
     int                row;
@@ -47,6 +48,7 @@ pum_display(array, size, selected, row, height, col)
     int                w;
     int                def_width = PUM_DEF_WIDTH;
     int                max_width = 0;
+    int                extra_width = 0;
     int                i;
 
     /*
@@ -87,13 +89,20 @@ pum_display(array, size, selected, row, height, col)
     if (pum_height < 1 || (pum_height == 1 && size > 1))
        return;
 
-    /* Compute the width of the widest match. */
+    /* Compute the width of the widest match and the widest extra. */
     for (i = 0; i < size; ++i)
     {
-       w = vim_strsize(array[i]);
+       w = vim_strsize(array[i].pum_text);
        if (max_width < w)
            max_width = w;
+       if (array[i].pum_extra != NULL)
+       {
+           w = vim_strsize(array[i].pum_extra);
+           if (extra_width < w)
+               extra_width = w;
+       }
     }
+    pum_base_width = max_width;
 
     /* if there are more items than room we need a scrollbar */
     if (pum_height < size)
@@ -112,8 +121,13 @@ pum_display(array, size, selected, row, height, col)
        /* align pum column with "col" */
        pum_col = col;
        pum_width = Columns - pum_col - pum_scrollbar;
-       if (pum_width > def_width)
-           pum_width = def_width;
+       if (pum_width > max_width + extra_width + 1
+                                                && pum_width > PUM_DEF_WIDTH)
+       {
+           pum_width = max_width + extra_width + 1;
+           if (pum_width < PUM_DEF_WIDTH)
+               pum_width = PUM_DEF_WIDTH;
+       }
     }
     else if (Columns < def_width)
     {
@@ -153,9 +167,10 @@ pum_redraw()
     int                idx;
     char_u     *s;
     char_u     *p;
-    int                width, w;
+    int                totwidth, width, w;
     int                thumb_pos = 0;
     int                thumb_heigth = 1;
+    int                round;
 
     if (pum_scrollbar)
     {
@@ -176,32 +191,46 @@ pum_redraw()
        if (pum_col > 0)
            screen_putchar(' ', row, pum_col - 1, attr);
 
-       /* Display each entry, use two spaces for a Tab. */
+       /* Display each entry, use two spaces for a Tab.
+        * Do this twice: For the main text and for the extra info */
        col = pum_col;
-       width = 0;
-       s = NULL;
-       for (p = pum_array[idx]; ; mb_ptr_adv(p))
+       totwidth = 0;
+       for (round = 1; round <= 2; ++round)
        {
-           if (s == NULL)
-               s = p;
-           w = ptr2cells(p);
-           if (*p == NUL || *p == TAB || width + w > pum_width)
+           width = 0;
+           s = NULL;
+           for (p = round == 1 ? pum_array[idx].pum_text
+                               : pum_array[idx].pum_extra; ; mb_ptr_adv(p))
            {
-               /* Display the text that fits or comes before a Tab. */
-               screen_puts_len(s, p - s, row, col, attr);
-               col += width;
-
-               if (*p != TAB)
-                   break;
-
-               /* Display two spaces for a Tab. */
-               screen_puts_len((char_u *)"  ", 2, row, col, attr);
-               col += 2;
-               s = NULL;
-               width = 0;
+               if (s == NULL)
+                   s = p;
+               w = ptr2cells(p);
+               if (*p == NUL || *p == TAB || totwidth + w > pum_width)
+               {
+                   /* Display the text that fits or comes before a Tab. */
+                   screen_puts_len(s, p - s, row, col, attr);
+                   col += width;
+
+                   if (*p != TAB)
+                       break;
+
+                   /* Display two spaces for a Tab. */
+                   screen_puts_len((char_u *)"  ", 2, row, col, attr);
+                   col += 2;
+                   totwidth += 2;
+                   s = NULL;       /* start text at next char */
+                   width = 0;
+               }
+               else
+                   width += w;
            }
-           else
-               width += w;
+           if (round == 2 || pum_array[idx].pum_extra == NULL
+                                          || pum_base_width + 1 >= pum_width)
+               break;
+           screen_fill(row, row + 1, col, pum_col + pum_base_width + 1,
+                                                             ' ', ' ', attr);
+           col = pum_col + pum_base_width + 1;
+           totwidth = pum_base_width + 1;
        }
 
        screen_fill(row, row + 1, col, pum_col + pum_width, ' ', ' ', attr);
index 27594f02440583266310a6583113b067a961f0b6..3939efc371452098f40a8007bb6a0d9a126e2f6f 100644 (file)
@@ -8,7 +8,7 @@ void truncate_spaces __ARGS((char_u *line));
 void backspace_until_column __ARGS((int col));
 int vim_is_ctrl_x_key __ARGS((int c));
 int ins_compl_add_infercase __ARGS((char_u *str, int len, char_u *fname, int dir, int flags));
-int ins_compl_add __ARGS((char_u *str, int len, char_u *fname, int dir, int flags));
+int ins_compl_add __ARGS((char_u *str, int len, char_u *fname, char_u *extra, int cdir, int flags));
 void ins_compl_show_pum __ARGS((void));
 char_u *find_word_start __ARGS((char_u *ptr));
 char_u *find_word_end __ARGS((char_u *ptr));
index a6490cab68a475a2bac8d93cc544243c2244e5f6..b8ba21514e5cf48fe7b88482173d92998a9e7388 100644 (file)
@@ -42,15 +42,15 @@ void ex_lockvar __ARGS((exarg_T *eap));
 int do_unlet __ARGS((char_u *name, int forceit));
 void del_menutrans_vars __ARGS((void));
 char_u *get_user_var_name __ARGS((expand_T *xp, int idx));
+list_T *list_alloc __ARGS((void));
 void list_unref __ARGS((list_T *l));
+void list_free __ARGS((list_T *l));
 dictitem_T *dict_lookup __ARGS((hashitem_T *hi));
 int list_append_dict __ARGS((list_T *list, dict_T *dict));
 int garbage_collect __ARGS((void));
-list_T *list_alloc __ARGS((void));
-void list_free __ARGS((list_T *l));
 dict_T *dict_alloc __ARGS((void));
 int dict_add_nr_str __ARGS((dict_T *d, char *key, long nr, char_u *str));
-char_u *get_dict_string __ARGS((dict_T *d, char_u *key));
+char_u *get_dict_string __ARGS((dict_T *d, char_u *key, int save));
 long get_dict_number __ARGS((dict_T *d, char_u *key));
 char_u *get_function_name __ARGS((expand_T *xp, int idx));
 char_u *get_expr_name __ARGS((expand_T *xp, int idx));
index 119d0395f7cd4dd94b611e5fd5dd04fa4866f0cf..05f9eabb343c8b7915f0afa02138f100e0fea0b7 100644 (file)
@@ -1,5 +1,5 @@
 /* popupmenu.c */
-void pum_display __ARGS((char_u **array, int size, int selected, int row, int height, int col));
+void pum_display __ARGS((pumitem_T *array, int size, int selected, int row, int height, int col));
 void pum_redraw __ARGS((void));
 void pum_set_selected __ARGS((int n));
 void pum_undisplay __ARGS((void));
index 152f9064f6d4359a56e7b69a503281271f08cff6..408bf6decb3c49b9a878cffe94a9658de2b95261 100644 (file)
@@ -1,7 +1,8 @@
 /* quickfix.c */
 int qf_init __ARGS((win_T *wp, char_u *efile, char_u *errorformat, int newlist));
 void qf_free_all __ARGS((win_T *wp));
-void qf_jump __ARGS((win_T *wp, int dir, int errornr, int forceit));
+void copy_loclist __ARGS((win_T *from, win_T *to));
+void qf_jump __ARGS((qf_info_T *qi, int dir, int errornr, int forceit));
 void qf_list __ARGS((exarg_T *eap));
 void qf_age __ARGS((exarg_T *eap));
 void qf_mark_adjust __ARGS((win_T *wp, linenr_T line1, linenr_T line2, long amount, long amount_after));
@@ -26,5 +27,4 @@ int set_errorlist __ARGS((win_T *wp, list_T *list, int action));
 void ex_cbuffer __ARGS((exarg_T *eap));
 void ex_cexpr __ARGS((exarg_T *eap));
 void ex_helpgrep __ARGS((exarg_T *eap));
-void copy_loclist __ARGS((win_T *from, win_T *to));
 /* vim: set ft=c : */
index 7136b7eff1aa945d27e11534d8e60d0c1385bb93..f9278a2f0d98dbcc5834ad930817d82791842c05 100644 (file)
@@ -954,19 +954,21 @@ qf_add_entry(qi, prevp, dir, fname, mesg, lnum, col, vis_col, pattern, nr, type,
 }
 
 /*
- * Allocate a new location list for window 'wp'
+ * Allocate a new location list
  */
-    static int
-ll_new_list(wp)
-    win_T   *wp;
+    static qf_info_T *
+ll_new_list()
 {
-    if ((wp->w_llist = (qf_info_T *)alloc((unsigned)sizeof(qf_info_T))) == NULL)
-       return FAIL;
+    qf_info_T *qi;
 
-    vim_memset(wp->w_llist, 0, (size_t)(sizeof(qf_info_T)));
-    wp->w_llist->qf_refcount++;
+    qi = (qf_info_T *)alloc((unsigned)sizeof(qf_info_T));
+    if (qi != NULL)
+    {
+       vim_memset(qi, 0, (size_t)(sizeof(qf_info_T)));
+       qi->qf_refcount++;
+    }
 
-    return OK;
+    return qi;
 }
 
 /*
@@ -988,8 +990,7 @@ ll_get_or_alloc_list(wp)
     ll_free_all(&wp->w_llist_ref);
 
     if (wp->w_llist == NULL)
-       if (ll_new_list(wp) == FAIL)    /* new location list */
-           return NULL;
+       wp->w_llist = ll_new_list();        /* new location list */
     return wp->w_llist;
 }
 
@@ -1018,7 +1019,8 @@ copy_loclist(from, to)
     if (qi == NULL)                /* no location list to copy */
        return;
 
-    if (ll_new_list(to) == FAIL)    /* allocate a new location list */
+    /* allocate a new location list */
+    if ((to->w_llist = ll_new_list()) == NULL)
        return;
 
     to->w_llist->qf_listcount = qi->qf_listcount;
@@ -1331,13 +1333,12 @@ qf_guess_filepath(filename)
  * else go to entry "errornr"
  */
     void
-qf_jump(winptr, dir, errornr, forceit)
-    win_T      *winptr;
+qf_jump(qi, dir, errornr, forceit)
+    qf_info_T  *qi;
     int                dir;
     int                errornr;
     int                forceit;
 {
-    qf_info_T          *qi = &ql_info;
     qf_info_T          *ll_ref;
     qfline_T           *qf_ptr;
     qfline_T           *old_qf_ptr;
@@ -1367,8 +1368,8 @@ qf_jump(winptr, dir, errornr, forceit)
     int                        ok = OK;
     int                        usable_win;
 
-    if (winptr != NULL)
-       qi = GET_LOC_LIST(winptr);
+    if (qi == NULL)
+       qi = &ql_info;
 
     if (qi->qf_curlist >= qi->qf_listcount
        || qi->qf_lists[qi->qf_curlist].qf_count == 0)
@@ -1494,6 +1495,14 @@ qf_jump(winptr, dir, errornr, forceit)
 
            if (curwin->w_height < p_hh)
                win_setheight((int)p_hh);
+
+           if (qi != &ql_info)     /* not a quickfix list */
+           {
+               /* The new window should use the supplied location list */
+               qf_free_all(curwin);
+               curwin->w_llist = qi;
+               qi->qf_refcount++;
+           }
        }
 
        if (!p_im)
@@ -2583,7 +2592,7 @@ ex_make(eap)
     char_u     *cmd;
     unsigned   len;
     win_T      *wp = NULL;
-    qf_info_T  *qi;
+    qf_info_T  *qi = &ql_info;
 #ifdef FEAT_AUTOCMD
     char_u     *au_name = NULL;
 
@@ -2667,7 +2676,7 @@ ex_make(eap)
                                           (eap->cmdidx != CMD_grepadd
                                            && eap->cmdidx != CMD_lgrepadd)) > 0
            && !eap->forceit)
-       qf_jump(wp, 0, 0, FALSE);               /* display first error */
+       qf_jump(qi, 0, 0, FALSE);               /* display first error */
 
     mch_remove(fname);
     vim_free(fname);
@@ -2745,11 +2754,12 @@ get_mef_name()
 ex_cc(eap)
     exarg_T    *eap;
 {
-    win_T      *wp = NULL;
-    qf_info_T  *qi;
+    qf_info_T  *qi = &ql_info;
 
-    if (eap->cmdidx == CMD_ll || eap->cmdidx == CMD_lrewind
-       || eap->cmdidx == CMD_lfirst || eap->cmdidx == CMD_llast)
+    if (eap->cmdidx == CMD_ll
+           || eap->cmdidx == CMD_lrewind
+           || eap->cmdidx == CMD_lfirst
+           || eap->cmdidx == CMD_llast)
     {
        qi = GET_LOC_LIST(curwin);
        if (qi == NULL)
@@ -2757,10 +2767,9 @@ ex_cc(eap)
            EMSG(_(e_loclist));
            return;
        }
-       wp = curwin;
     }
 
-    qf_jump(wp, 0,
+    qf_jump(qi, 0,
            eap->addr_count > 0
            ? (int)eap->line2
            : (eap->cmdidx == CMD_cc || eap->cmdidx == CMD_ll)
@@ -2780,12 +2789,14 @@ ex_cc(eap)
 ex_cnext(eap)
     exarg_T    *eap;
 {
-    win_T      *wp = NULL;
-    qf_info_T  *qi;
+    qf_info_T  *qi = &ql_info;
 
-    if (eap->cmdidx == CMD_lnext || eap->cmdidx == CMD_lNext
-       || eap->cmdidx == CMD_lprevious || eap->cmdidx == CMD_lnfile
-       || eap->cmdidx == CMD_lNfile || eap->cmdidx == CMD_lpfile)
+    if (eap->cmdidx == CMD_lnext
+           || eap->cmdidx == CMD_lNext
+           || eap->cmdidx == CMD_lprevious
+           || eap->cmdidx == CMD_lnfile
+           || eap->cmdidx == CMD_lNfile
+           || eap->cmdidx == CMD_lpfile)
     {
        qi = GET_LOC_LIST(curwin);
        if (qi == NULL)
@@ -2793,10 +2804,9 @@ ex_cnext(eap)
            EMSG(_(e_loclist));
            return;
        }
-       wp = curwin;
     }
 
-    qf_jump(wp, (eap->cmdidx == CMD_cnext || eap->cmdidx == CMD_lnext)
+    qf_jump(qi, (eap->cmdidx == CMD_cnext || eap->cmdidx == CMD_lnext)
            ? FORWARD
            : (eap->cmdidx == CMD_cnfile || eap->cmdidx == CMD_lnfile)
                ? FORWARD_FILE
@@ -2816,7 +2826,7 @@ ex_cfile(eap)
     exarg_T    *eap;
 {
     win_T      *wp = NULL;
-    qf_info_T  *qi;
+    qf_info_T  *qi = &ql_info;
 
     if (eap->cmdidx == CMD_lfile || eap->cmdidx == CMD_lgetfile
        || eap->cmdidx == CMD_laddfile)
@@ -2844,7 +2854,7 @@ ex_cfile(eap)
                                  && eap->cmdidx != CMD_laddfile)) > 0
                                  && (eap->cmdidx == CMD_cfile
                                             || eap->cmdidx == CMD_lfile))
-       qf_jump(wp, 0, 0, eap->forceit);        /* display first error */
+       qf_jump(qi, 0, 0, eap->forceit);        /* display first error */
 }
 
 /*
@@ -2865,7 +2875,6 @@ ex_vimgrep(eap)
     int                fi;
     qf_info_T  *qi = &ql_info;
     qfline_T   *prevp = NULL;
-    win_T      *wp = NULL;
     long       lnum;
     buf_T      *buf;
     int                duplicate_name = FALSE;
@@ -2899,13 +2908,14 @@ ex_vimgrep(eap)
     }
 #endif
 
-    if (eap->cmdidx == CMD_grep || eap->cmdidx == CMD_lvimgrep
-       || eap->cmdidx == CMD_lgrepadd || eap->cmdidx == CMD_lvimgrepadd)
+    if (eap->cmdidx == CMD_grep
+           || eap->cmdidx == CMD_lvimgrep
+           || eap->cmdidx == CMD_lgrepadd
+           || eap->cmdidx == CMD_lvimgrepadd)
     {
        qi = ll_get_or_alloc_list(curwin);
        if (qi == NULL)
            return;
-       wp = curwin;
     }
 
     /* Get the search pattern: either white-separated or enclosed in // */
@@ -3105,7 +3115,7 @@ ex_vimgrep(eap)
     if (qi->qf_lists[qi->qf_curlist].qf_count > 0)
     {
        if ((flags & VGR_NOJUMP) == 0)
-           qf_jump(wp, 0, 0, eap->forceit);
+           qf_jump(qi, 0, 0, eap->forceit);
     }
     else
        EMSG2(_(e_nomatch2), s);
@@ -3376,14 +3386,14 @@ set_errorlist(wp, list, action)
        if (d == NULL)
            continue;
 
-       filename = get_dict_string(d, (char_u *)"filename");
+       filename = get_dict_string(d, (char_u *)"filename", TRUE);
        lnum = get_dict_number(d, (char_u *)"lnum");
        col = get_dict_number(d, (char_u *)"col");
        vcol = get_dict_number(d, (char_u *)"vcol");
        nr = get_dict_number(d, (char_u *)"nr");
-       type = get_dict_string(d, (char_u *)"type");
-       pattern = get_dict_string(d, (char_u *)"pattern");
-       text = get_dict_string(d, (char_u *)"text");
+       type = get_dict_string(d, (char_u *)"type", TRUE);
+       pattern = get_dict_string(d, (char_u *)"pattern", TRUE);
+       text = get_dict_string(d, (char_u *)"text", TRUE);
        if (text == NULL)
            text = vim_strsave((char_u *)"");
 
@@ -3484,14 +3494,12 @@ ex_cexpr(eap)
 {
     typval_T   *tv;
     qf_info_T  *qi = &ql_info;
-    win_T      *wp = NULL;
 
     if (eap->cmdidx == CMD_lexpr || eap->cmdidx == CMD_laddexpr)
     {
        qi = ll_get_or_alloc_list(curwin);
        if (qi == NULL)
            return;
-       wp = curwin;
     }
 
     /* Evaluate the expression.  When the result is a string or a list we can
@@ -3507,7 +3515,7 @@ ex_cexpr(eap)
                             || eap->cmdidx == CMD_lexpr),
                                                 (linenr_T)0, (linenr_T)0) > 0
                    && (eap->cmdidx == CMD_cexpr || eap->cmdidx == CMD_lexpr))
-               qf_jump(wp, 0, 0, eap->forceit);  /* display first error */
+               qf_jump(qi, 0, 0, eap->forceit);  /* display first error */
        }
        else
            EMSG(_("E777: String or List expected"));
@@ -3536,6 +3544,8 @@ ex_helpgrep(eap)
     char_u     *lang;
 #endif
     qf_info_T  *qi = &ql_info;
+    int                new_qi = FALSE;
+    win_T      *wp;
 
     /* Make 'cpoptions' empty, the 'l' flag should not be used here. */
     save_cpo = p_cpo;
@@ -3546,6 +3556,27 @@ ex_helpgrep(eap)
     lang = check_help_lang(eap->arg);
 #endif
 
+    if (eap->cmdidx == CMD_lhelpgrep)
+    {
+       /* Find an existing help window */
+       FOR_ALL_WINDOWS(wp)
+           if (wp->w_buffer != NULL && wp->w_buffer->b_help)
+               break;
+
+       if (wp == NULL)     /* Help window not found */
+           qi = NULL;
+       else
+           qi = wp->w_llist;
+
+       if (qi == NULL)
+       {
+           /* Allocate a new location list for help text matches */
+           if ((qi = ll_new_list()) == NULL)
+               return;
+           new_qi = TRUE;
+       }
+    }
+
     regmatch.regprog = vim_regcomp(eap->arg, RE_MAGIC + RE_STRING);
     regmatch.rm_ic = FALSE;
     if (regmatch.regprog != NULL)
@@ -3635,9 +3666,23 @@ ex_helpgrep(eap)
 
     /* Jump to first match. */
     if (qi->qf_lists[qi->qf_curlist].qf_count > 0)
-       qf_jump(NULL, 0, 0, FALSE);
+       qf_jump(qi, 0, 0, FALSE);
     else
        EMSG2(_(e_nomatch2), eap->arg);
+
+    if (eap->cmdidx == CMD_lhelpgrep)
+    {
+       /* If the help window is not opened or if it already points to the
+        * correct location list, then free the new location list
+        */ 
+       if (!curwin->w_buffer->b_help || curwin->w_llist == qi)
+       {
+           if (new_qi)
+               ll_free_all(&qi);
+       }
+       else if (curwin->w_llist == NULL)
+           curwin->w_llist = qi;
+    }
 }
 
 #endif /* FEAT_QUICKFIX */
index e8d5b72ed70b664afa8e71a10d295214a1bf828d..462ee521c7177584625bf69531e3bdd777ab792a 100644 (file)
@@ -1085,9 +1085,7 @@ struct dictvar_S
 # define B_SPELL(buf)  (0)
 #endif
 
-#ifdef FEAT_QUICKFIX
 typedef struct qf_info_S qf_info_T;
-#endif
 
 /*
  * buffer: structure that holds information about one file
@@ -2148,3 +2146,13 @@ typedef struct
 } prt_settings_T;
 
 #define PRINT_NUMBER_WIDTH 8
+
+/*
+ * Used for popup menu items.
+ */
+typedef struct
+{
+    char_u     *pum_text;      /* main menu text */
+    char_u     *pum_extra;     /* extra menu text (may be truncated) */
+    char_u     *pum_info;      /* extra info */
+} pumitem_T;
index 5d6c7f962db7a67a981143bcb29a8a78d3e82077..14b374d5c7e2db8a7807d2a243312fedb2fa70ec 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 (2006 Feb 4)"
-#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 4, compiled "
+#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 7)"
+#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 7, compiled "