Compare commits

...

8 Commits

Author SHA1 Message Date
Bram Moolenaar
f52c725c47 updated for version 7.0196 2006-02-10 23:23:57 +00:00
Bram Moolenaar
c7453f52d4 updated for version 7.0196 2006-02-10 23:20:28 +00:00
Bram Moolenaar
110bc6bc91 updated for version 7.0196 2006-02-10 23:13:40 +00:00
Bram Moolenaar
06b5db9397 updated for version 7.0196 2006-02-10 23:11:56 +00:00
Bram Moolenaar
3d0a603fa9 updated for version 7.0195 2006-02-09 23:54:54 +00:00
Bram Moolenaar
754b56089f updated for version 7.0195 2006-02-09 23:53:20 +00:00
Bram Moolenaar
cf0c554e3f updated for version 7.0195 2006-02-09 23:48:02 +00:00
Bram Moolenaar
8b6144bdfe updated for version 7.0194 2006-02-08 09:20:24 +00:00
53 changed files with 1331 additions and 564 deletions

View 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 10
" This function is used for the 'omnifunc' option.
@@ -213,24 +213,54 @@ 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 = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename'])
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 line = a:val['tagline']
let word = a:val['match'] . a:brackets . s:GetAddition(line, a:val['match'], [a:val], a:brackets == '')
if has_key(a:val, 'extra')
return {'word': word, 'menu': a:val['extra']}
endif
" Isolate the command after the tag and filename.
let s = matchstr(line, '[^\t]*\t[^\t]*\t\zs\(/^.*$/\|[^\t]*\)\ze\(;"\t\|\t\|$\)')
if s != ''
return {'word': word, 'menu': s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t'))}
endif
return {'word': word}
endfunction
" Turn a command from a tag line to something that is useful in the menu
function! s:Tagcmd2extra(cmd, name, fname)
if a:cmd =~ '^/^'
" The command is a search command, useful to see what it is.
let x = matchstr(a:cmd, '^/^\zs.*\ze$/')
let x = substitute(x, a:name, '@@', '')
let x = substitute(x, '\\\(.\)', '\1', 'g')
let x = x . ' - ' . a:fname
elseif a:cmd =~ '^\d*$'
" The command is a line number, the file name is more useful.
let x = a:fname . ' - ' . a:cmd
else
" Not recognized, use command and file name.
let x = a:cmd . ' - ' . a:fname
endif
return x
endfunction
" Find composing type in "lead" and match items[0] with it.
" Repeat this recursively for items[1], if it's there.

View 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:

View 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:

View 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()

View File

@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Feb 01
*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Feb 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -278,6 +278,9 @@ Name triggered by ~
|FocusGained| Vim got input focus
|FocusLost| Vim lost input focus
|CursorHold| the user doesn't press a key for a while
|CursorHoldI| the user doesn't press a key for a while in Insert mode
|CursorMoved| the cursor was moved in Normal mode
|CursorMovedI| the cursor was moved in Insert mode
|WinEnter| after entering another window
|WinLeave| before leaving a window
@@ -440,6 +443,7 @@ CmdwinLeave Before leaving the command-line window.
|cmdwin-char|
*ColorScheme*
ColorScheme After loading a color scheme. |:colorscheme|
*CursorHold*
CursorHold When the user doesn't press a key for the time
specified with 'updatetime'. Not re-triggered
@@ -460,6 +464,18 @@ CursorHold When the user doesn't press a key for the time
:let &ro = &ro
< {only on Amiga, Unix, Win32, MSDOS and all GUI
versions}
*CursorHoldI*
CursorHoldI Just like CursorHold, but in Insert mode.
*CursorMoved*
CursorMoved After the cursor was moved in Normal mode.
Not triggered when there is typeahead or when
an operator is pending.
Careful: Don't do anything that the user does
not expect or that is slow.
*CursorMovedI*
CursorMovedI After the cursor was moved in Insert mode.
Otherwise the same as CursorMoved.
*EncodingChanged*
EncodingChanged Fires off after the 'encoding' option has been
changed. Useful to set up fonts, for example.

View File

@@ -479,6 +479,7 @@ followed by another command:
:global
:help
:helpfind
:lcscope
:make
:normal
:perl

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.0aa. Last change: 2006 Feb 03
*eval.txt* For Vim version 7.0aa. Last change: 2006 Feb 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -3210,6 +3210,8 @@ line({expr}) The result is a Number, which is the line number of the file
$ the last line in the current buffer
'x position of mark x (if the mark is not set, 0 is
returned)
w0 first line visible in current window
w$ last line visible in current window
Note that only marks in the current file can be used.
Examples: >
line(".") line number of the cursor

View File

@@ -191,13 +191,6 @@ Standard plugins ~
|pi_expl.txt| File explorer
LOCAL ADDITIONS: *local-additions*
|cecutil.txt| DrChip's Utilities Jun 11, 2004
|engspchk.txt| English Spelling Checker (v61) Mar 14, 2005
|example.txt| Example for a locally added help file
|matchit.txt| Extended "%" matching
|test.txt| Testing the h<>lp c<>mm<6D>nd n<>w
|typecorr.txt| Plugin for correcting typing mistakes
|helpp.txt| Dummy line to avoid an error message
------------------------------------------------------------------------------
*bars* Bars example

View File

@@ -208,6 +208,11 @@ The available subcommands are:
USAGE :cs show
*:lcscope* *:lcs*
This command is same as the ":cscope" command, except when the
'cscopequickfix' option is set, the location list for the current window is
used instead of the quickfix list to show the cscope results.
*:cstag* *E257* *E562*
If you use cscope as well as ctags, |:cstag| allows you to search one or
the other before making a jump. For example, you can choose to first

View File

@@ -1226,6 +1226,7 @@ The commands are sorted on the non-optional part of their name.
|:lcd| :lc[d] change directory locally
|:lchdir| :lch[dir] change directory locally
|:lclose| :lcl[ose] close location window
|:lcscope| :lcs[cope] like ":cscope" but uses location list
|:left| :le[ft] left align lines
|:leftabove| :lefta[bove] make split window appear left or above
|:let| :let assign a value to a variable or option
@@ -1235,6 +1236,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

View 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 10
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,24 @@ 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
<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.
<Up> Select the previous match, as if CTRL-P was used, but don't
insert it when editing the selection.
<Down> Select the next match, as if CTRL-N was used, but don't
insert it when editing the selection.
The selection is being edited after typing <BS>, CTRL-L or when using the
longest common match. This stops when a match is inserted, as with CTRL-N or
CTRL-P.
The colors of the menu can be changed with these highlight groups:
Pmenu normal item |hl-Pmenu|
@@ -1073,6 +1108,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 +1141,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 +1157,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 +1179,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

View File

@@ -1,4 +1,4 @@
*map.txt* For Vim version 7.0aa. Last change: 2006 Jan 13
*map.txt* For Vim version 7.0aa. Last change: 2006 Feb 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -45,42 +45,42 @@ modes.
{lhs} means left-hand-side *{lhs}*
{rhs} means right-hand-side *{rhs}*
:map {lhs} {rhs} *:map*
:nm[ap] {lhs} {rhs} *:nm* *:nmap*
:vm[ap] {lhs} {rhs} *:vm* *:vmap*
:om[ap] {lhs} {rhs} *:om* *:omap*
:map! {lhs} {rhs} *:map!*
:im[ap] {lhs} {rhs} *:im* *:imap*
:lm[ap] {lhs} {rhs} *:lm* *:lmap*
:cm[ap] {lhs} {rhs} *:cm* *:cmap*
:map {lhs} {rhs} |mapmode-nvo| *:map*
:nm[ap] {lhs} {rhs} |mapmode-n| *:nm* *:nmap*
:vm[ap] {lhs} {rhs} |mapmode-v| *:vm* *:vmap*
:om[ap] {lhs} {rhs} |mapmode-o| *:om* *:omap*
:map! {lhs} {rhs} |mapmode-ic| *:map!*
:im[ap] {lhs} {rhs} |mapmode-i| *:im* *:imap*
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lmap*
:cm[ap] {lhs} {rhs} |mapmode-c| *:cm* *:cmap*
Map the key sequence {lhs} to {rhs} for the modes
where the map command applies. The result, including
{rhs}, is then further scanned for mappings. This
allows for nested and recursive use of mappings.
:no[remap] {lhs} {rhs} *:no* *:noremap*
:nn[oremap] {lhs} {rhs} *:nn* *:nnoremap*
:vn[oremap] {lhs} {rhs} *:vn* *:vnoremap*
:ono[remap] {lhs} {rhs} *:ono* *:onoremap*
:no[remap]! {lhs} {rhs} *:no!* *:noremap!*
:ino[remap] {lhs} {rhs} *:ino* *:inoremap*
:ln[oremap] {lhs} {rhs} *:ln* *:lnoremap*
:cno[remap] {lhs} {rhs} *:cno* *:cnoremap*
:no[remap] {lhs} {rhs} |mapmode-nvo| *:no* *:noremap*
:nn[oremap] {lhs} {rhs} |mapmode-n| *:nn* *:nnoremap*
:vn[oremap] {lhs} {rhs} |mapmode-v| *:vn* *:vnoremap*
:ono[remap] {lhs} {rhs} |mapmode-o| *:ono* *:onoremap*
:no[remap]! {lhs} {rhs} |mapmode-ic| *:no!* *:noremap!*
:ino[remap] {lhs} {rhs} |mapmode-i| *:ino* *:inoremap*
:ln[oremap] {lhs} {rhs} |mapmode-l| *:ln* *:lnoremap*
:cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnoremap*
Map the key sequence {lhs} to {rhs} for the modes
where the map command applies. Disallow mapping of
{rhs}, to avoid nested and recursive mappings. Often
used to redefine a command. {not in Vi}
:unm[ap] {lhs} *:unm* *:unmap*
:nun[map] {lhs} *:nun* *:nunmap*
:vu[nmap] {lhs} *:vu* *:vunmap*
:ou[nmap] {lhs} *:ou* *:ounmap*
:unm[ap]! {lhs} *:unm!* *:unmap!*
:iu[nmap] {lhs} *:iu* *:iunmap*
:lu[nmap] {lhs} *:lu* *:lunmap*
:cu[nmap] {lhs} *:cu* *:cunmap*
:unm[ap] {lhs} |mapmode-nvo| *:unm* *:unmap*
:nun[map] {lhs} |mapmode-n| *:nun* *:nunmap*
:vu[nmap] {lhs} |mapmode-v| *:vu* *:vunmap*
:ou[nmap] {lhs} |mapmode-o| *:ou* *:ounmap*
:unm[ap]! {lhs} |mapmode-ic| *:unm!* *:unmap!*
:iu[nmap] {lhs} |mapmode-i| *:iu* *:iunmap*
:lu[nmap] {lhs} |mapmode-l| *:lu* *:lunmap*
:cu[nmap] {lhs} |mapmode-c| *:cu* *:cunmap*
Remove the mapping of {lhs} for the modes where the
map command applies. The mapping may remain defined
for other modes where it applies.
@@ -89,38 +89,38 @@ modes.
:map @@ foo
:unmap @@ | print
:mapc[lear] *:mapc* *:mapclear*
:nmapc[lear] *:nmapc* *:nmapclear*
:vmapc[lear] *:vmapc* *:vmapclear*
:omapc[lear] *:omapc* *:omapclear*
:mapc[lear]! *:mapc!* *:mapclear!*
:imapc[lear] *:imapc* *:imapclear*
:lmapc[lear] *:lmapc* *:lmapclear*
:cmapc[lear] *:cmapc* *:cmapclear*
:mapc[lear] |mapmode-nvo| *:mapc* *:mapclear*
:nmapc[lear] |mapmode-n| *:nmapc* *:nmapclear*
:vmapc[lear] |mapmode-v| *:vmapc* *:vmapclear*
:omapc[lear] |mapmode-o| *:omapc* *:omapclear*
:mapc[lear]! |mapmode-ic| *:mapc!* *:mapclear!*
:imapc[lear] |mapmode-i| *:imapc* *:imapclear*
:lmapc[lear] |mapmode-l| *:lmapc* *:lmapclear*
:cmapc[lear] |mapmode-c| *:cmapc* *:cmapclear*
Remove ALL mappings for the modes where the map
command applies. {not in Vi}
Warning: This also removes the default mappings.
:map
:nm[ap]
:vm[ap]
:om[ap]
:map!
:im[ap]
:lm[ap]
:cm[ap]
:map |mapmode-nvo|
:nm[ap] |mapmode-n|
:vm[ap] |mapmode-v|
:om[ap] |mapmode-o|
:map! |mapmode-ic|
:im[ap] |mapmode-i|
:lm[ap] |mapmode-l|
:cm[ap] |mapmode-c|
List all key mappings for the modes where the map
command applies. Note that ":map" and ":map!" are
used most often, because they include the other modes.
:map {lhs} *:map_l*
:nm[ap] {lhs} *:nmap_l*
:vm[ap] {lhs} *:vmap_l*
:om[ap] {lhs} *:omap_l*
:map! {lhs} *:map_l!*
:im[ap] {lhs} *:imap_l*
:lm[ap] {lhs} *:lmap_l*
:cm[ap] {lhs} *:cmap_l*
:map {lhs} |mapmode-nvo| *:map_l*
:nm[ap] {lhs} |mapmode-n| *:nmap_l*
:vm[ap] {lhs} |mapmode-v| *:vmap_l*
:om[ap] {lhs} |mapmode-o| *:omap_l*
:map! {lhs} |mapmode-ic| *:map_l!*
:im[ap] {lhs} |mapmode-i| *:imap_l*
:lm[ap] {lhs} |mapmode-l| *:lmap_l*
:cm[ap] {lhs} |mapmode-c| *:cmap_l*
List the key mappings for the key sequences starting
with {lhs} in the modes where the map command applies.
{not in Vi}
@@ -218,6 +218,7 @@ to type a count with a zero.
*map-overview* *map-modes*
Overview of which map command works in which mode:
*mapmode-nvo* *mapmode-n* *mapmode-v* *mapmode-o*
commands: modes: ~
Normal Visual Operator-pending ~
:map :noremap :unmap :mapclear yes yes yes
@@ -225,6 +226,7 @@ Overview of which map command works in which mode:
:vmap :vnoremap :vunmap :vmapclear - yes -
:omap :onoremap :ounmap :omapclear - - yes
*mapmode-ic* *mapmode-i* *mapmode-c* *mapmode-l*
Insert Command-line Lang-Arg ~
:map! :noremap! :unmap! :mapclear! yes yes -
:imap :inoremap :iunmap :imapclear yes - -

View 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

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 02
*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1621,13 +1621,16 @@ A jump table for the options with a short description can be found at |Q_op|.
'completeopt' 'cot' string (default: "menu")
global
{not in Vi}
Options for Insert mode completion |ins-completion|.
Currently the only supported value is:
A comma separated list of options for Insert mode completion
|ins-completion|. The supported values are:
menu Use a popup menu to show the possible completions. The
menu is only shown when there is more than one match and
sufficient colors are available. |ins-completion-menu|
longest Only insert the longest common text of the matches. Use
CTRL-L to add more characters.
*'confirm'* *'cf'* *'noconfirm'* *'nocf'*
'confirm' 'cf' boolean (default off)

View File

@@ -2124,6 +2124,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:lchdir editing.txt /*:lchdir*
:lcl quickfix.txt /*:lcl*
:lclose quickfix.txt /*:lclose*
:lcs if_cscop.txt /*:lcs*
:lcscope if_cscop.txt /*:lcscope*
:le change.txt /*:le*
:left change.txt /*:left*
:lefta windows.txt /*:lefta*
@@ -2151,6 +2153,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*
@@ -3112,7 +3116,10 @@ Contents quickref.txt /*Contents*
Cscope if_cscop.txt /*Cscope*
CursorHold autocmd.txt /*CursorHold*
CursorHold-example windows.txt /*CursorHold-example*
CursorHoldI autocmd.txt /*CursorHoldI*
CursorIM mbyte.txt /*CursorIM*
CursorMoved autocmd.txt /*CursorMoved*
CursorMovedI autocmd.txt /*CursorMovedI*
D change.txt /*D*
DOS os_dos.txt /*DOS*
DOS-format editing.txt /*DOS-format*
@@ -5849,6 +5856,14 @@ mapcheck() eval.txt /*mapcheck()*
maple.vim syntax.txt /*maple.vim*
mapleader map.txt /*mapleader*
maplocalleader map.txt /*maplocalleader*
mapmode-c map.txt /*mapmode-c*
mapmode-i map.txt /*mapmode-i*
mapmode-ic map.txt /*mapmode-ic*
mapmode-l map.txt /*mapmode-l*
mapmode-n map.txt /*mapmode-n*
mapmode-nvo map.txt /*mapmode-nvo*
mapmode-o map.txt /*mapmode-o*
mapmode-v map.txt /*mapmode-v*
mapping map.txt /*mapping*
mark motion.txt /*mark*
mark-motions motion.txt /*mark-motions*

View 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 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -30,28 +30,16 @@ 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?
- 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?
- Flickering because of syntax highlighting redrawing further lines.
- 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.
Could build the list of items for each structure in memory. Is that faster?
Not using too much memory?
- When a typedef or struct is local to a file only use it in that file?
- Special mappings for when the popup menu is visible? Would allow for making
a specific selection (e.g, methods vs variables).
@@ -109,6 +97,12 @@ 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).
":keepundo": add change to existing undo chain, so that one "u" undoes them
all. (Gautam Iyer)
Mac unicode patch (Da Woon Jung):
- selecting proportional font breaks display
- UTF-8 text causes display problems. Font replacement causes this.
@@ -2255,31 +2249,25 @@ Autocommands:
8 Add ScriptReadCmd event: used to load remote Vim scripts, e.g.
"vim -u http://mach/path/vimrc".
7 Add TagJump event: do something after jumping to a tag.
8 Add "TagJumpFile" autocommand: When jumping to another file for a tag.
Can be used to open "main.c.gz" when "main.c" isn't found.
8 Use another option than 'updatetime' for the CursorHold event. The two
things are unrelated for the user (but the implementation is more
difficult).
8 Add an event like CursorHold that is triggered repeatedly, not just once.
8 Also trigger CursorHold in Insert mode?
7 Add autocommand event for when a buffer cannot be abandoned. So that user
can define the action taking (autowrite, dialog, fail) based on the kind
of file. (Yakov Lerner) Or is BufLeave sufficient?
8 Can't use ":normal" in CursorHold autocommands. Make the CursorHold event
insert a special key code, and call the autocommand functions from a
higher level, so that vgetc() isn't used recursively.
8 Autocommands should not change registers. And marks? And the jumplist?
And anything else?
8 Add an event like CursorHold that is triggered repeatedly, not just once
after typing something.
7 Add autocommand event for when a buffer cannot be abandoned. So that the
user can define the action taking (autowrite, dialog, fail) based on the
kind of file. (Yakov Lerner) Or is BufLeave sufficient?
8 Autocommand for when modified files have been found, when getting input
focus again (e.g., FileChangedFocus).
Check when: getting focus, jumping to another buffer, ...
8 Autocommands should not change registers. And marks? And the jumplist?
And anything else? Add a command to save and restore these things.
8 Add autocommands, user functions and user commands to ":mkvimrc".
8 Add "TagJumpFile" autocommand: When jumping to another file for a tag.
Can be used to open "main.c.gz" when "main.c" isn't found.
6 Add KeymapChanged event, so that the effects of a different keymap can be
handled (e.g., other font) (Ron Aaron)
7 Add a way to skip an autocommand if going from one *.c file to another *.c
file.
7 When trying to open a directory, don't load the file but trigger an
autocommand event OpenDirectory.
7 When trying to open a directory, trigger an OpenDirectory event.
7 Add file type in front of file pattern: <d> for directory, <l> for link,
<x> for executable, etc. <&xxx> for Risc OS. With commas to separate
alternatives. The autocommand is only executed when both the file type
@@ -2296,7 +2284,6 @@ Autocommands:
- Add events to autocommands:
Error - When an error happens
NormalEnter - Entering Normal mode
InsertEnter - Entering Insert mode
ReplaceEnter - Entering Replace mode
CmdEnter - Entering Cmdline mode
VisualEnter - Entering Visual mode

View 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}

View 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 10
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.
@@ -454,13 +457,37 @@ Win32: The ":winpos" command now also works in the console. (Vipin Aravind)
|:caddbuffer| Add errors from the current buffer to the quickfix
list.
|:ltag| Jump to a tag and add matching tags to a 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.
|:lprevious| Like |:cprevious| 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.
|:lmake| Like |:make| but use the location list.
|:lgrep| Like |:grep| but use the location list.
|:lgrepadd| Like |:grepadd| but use the location list.
|:lvimgrep| Like |:vimgrep| but use the location list.
|:lvimgrepadd| Like |:vimgrepadd| but use the location list.
|:laddbuffer| Like |:caddbuffer| but use the location list.
|:lhelpgrep| Like |:helpgrep| but use the location list.
|:lcscope| Like |:cscope| but use the location list.
|:ltag| Jump to a tag and add matching tags to a location list.
Ex command modifiers: ~
@@ -562,6 +589,10 @@ New autocommand events: ~
|SpellFileMissing| when a spell file can't be found
|CursorHoldI| the user doesn't press a key for a while in Insert mode
|CursorMoved| the cursor was moved in Normal mode
|CursorMovedI| the cursor was moved in Insert mode
New items in search patterns: ~
|/\%d| \%d123 search for character with decimal number
@@ -1652,4 +1683,7 @@ mapped. Use ":normal!" instead of ":normal". (Tony Apuzzo)
Crashed when expanding a file name argument in backticks.
In some situations the menu and scrollbar didn't work, when the value contains
a CSI byte. (Yukihiro Nakadaira)
vim:tw=78:ts=8:ft=help:norl:

View 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)

View 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

View 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

View 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

View 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

View 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)

View 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&"

View 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

6
src/auto/configure vendored
View File

@@ -1009,7 +1009,7 @@ gives unlimited permission to copy, distribute and modify it.
_ACEOF
exit 0
fi
exec 5>config.log
exec 5>auto/config.log
cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@@ -15455,7 +15455,7 @@ exec 6>&1
# Open the log real soon, to keep \$[0] and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. Logging --version etc. is OK.
exec 5>>config.log
exec 5>>auto/config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
@@ -16285,7 +16285,7 @@ if test "$no_create" != yes; then
ac_config_status_args="$ac_config_status_args --quiet"
exec 5>/dev/null
$SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
exec 5>>config.log
exec 5>>auto/config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
$ac_cs_success || { (exit 1); exit 1; }

View 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 */
};
@@ -91,6 +95,9 @@ static compl_T *compl_shown_match = NULL;
* are used. */
static char_u *compl_leader = NULL;
static int compl_get_longest = FALSE; /* put longest common string
in compl_leader */
static int compl_used_match; /* Selected one of the matches. When
FALSE the match was edited or using
the longest common string. */
@@ -115,23 +122,25 @@ 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_longest_match __ARGS((compl_T *match));
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));
static int ins_compl_next __ARGS((int allow_get_expansion, int count, int insert_match));
static int ins_compl_key2dir __ARGS((int c));
static int ins_compl_pum_key __ARGS((int c));
static int ins_compl_key2count __ARGS((int c));
@@ -144,7 +153,7 @@ static int quote_meta __ARGS((char_u *dest, char_u *str, int len));
#define BACKSPACE_WORD_NOT_SPACE 3
#define BACKSPACE_LINE 4
static void ins_redraw __ARGS((void));
static void ins_redraw __ARGS((int ready));
static void ins_ctrl_v __ARGS((void));
static void undisplay_dollar __ARGS((void));
static void insert_special __ARGS((int, int, int));
@@ -645,7 +654,7 @@ edit(cmdchar, startln, count)
* Redraw the display when no characters are waiting.
* Also shows mode, ruler and positions cursor.
*/
ins_redraw();
ins_redraw(TRUE);
#ifdef FEAT_SCROLLBIND
if (curwin->w_p_scb)
@@ -678,30 +687,47 @@ edit(cmdchar, startln, count)
#endif
#ifdef FEAT_INS_EXPAND
/* When the popup menu is visible cursor keys change the selection. */
if (c == K_UP && pum_visible())
c = Ctrl_P;
if (c == K_DOWN && pum_visible())
c = Ctrl_N;
/* 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;
}
/* Pressing Enter selects the current match. */
if (c == CAR || c == K_KENTER || c == NL)
{
ins_compl_delete();
ins_compl_insert();
}
}
}
/* Prepare for or stop CTRL-X mode. This doesn't do completion, but
* it does fix up the text when finishing completion. */
compl_get_longest = FALSE;
if (c != K_IGNORE && ins_compl_prep(c))
continue;
#endif
@@ -712,7 +738,7 @@ edit(cmdchar, startln, count)
if (c == Ctrl_BSL)
{
/* may need to redraw when no more chars available now */
ins_redraw();
ins_redraw(FALSE);
++no_mapping;
++allow_keys;
c = safe_vgetc();
@@ -1018,6 +1044,13 @@ doESCkey:
case K_IGNORE: /* Something mapped to nothing */
break;
#ifdef FEAT_AUTOCMD
case K_CURSORHOLD: /* Didn't type something for a while. */
apply_autocmds(EVENT_CURSORHOLDI, NULL, NULL, FALSE, curbuf);
did_cursorhold = TRUE;
break;
#endif
#ifdef FEAT_GUI_W32
/* On Win32 ignore <M-F4>, we get it when closing the window was
* cancelled. */
@@ -1076,6 +1109,10 @@ doESCkey:
break;
case K_UP: /* <Up> */
#ifdef FEAT_INS_EXPAND
if (pum_visible())
goto docomplete;
#endif
if (mod_mask & MOD_MASK_SHIFT)
ins_pageup();
else
@@ -1093,6 +1130,10 @@ doESCkey:
break;
case K_DOWN: /* <Down> */
#ifdef FEAT_INS_EXPAND
if (pum_visible())
goto docomplete;
#endif
if (mod_mask & MOD_MASK_SHIFT)
ins_pagedown();
else
@@ -1325,11 +1366,22 @@ force_cindent:
* Only redraw when there are no characters available. This speeds up
* inserting sequences of characters (e.g., for CTRL-R).
*/
/*ARGSUSED*/
static void
ins_redraw()
ins_redraw(ready)
int ready; /* not busy with something */
{
if (!char_avail())
{
#ifdef FEAT_AUTOCMD
/* Trigger CursorMoved if the cursor moved. */
if (ready && has_cursormovedI()
&& !equalpos(last_cursormoved, curwin->w_cursor))
{
apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf);
last_cursormoved = curwin->w_cursor;
}
#endif
if (must_redraw)
update_screen(0);
else if (clear_cmdline || redraw_cmdline)
@@ -1349,7 +1401,7 @@ ins_ctrl_v()
int c;
/* may need to redraw when no more chars available now */
ins_redraw();
ins_redraw(FALSE);
if (redrawing() && !char_avail())
edit_putchar('^', TRUE);
@@ -1822,7 +1874,7 @@ ins_ctrl_x()
/* if the next ^X<> won't ADD nothing, then reset
* compl_cont_status */
if (compl_cont_status & CONT_N_ADDS)
compl_cont_status = (compl_cont_status | CONT_INTRPT);
compl_cont_status |= CONT_INTRPT;
else
compl_cont_status = 0;
/* We're not sure which CTRL-X mode it will be yet */
@@ -1922,7 +1974,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 +2037,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 +2054,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 +2094,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 +2108,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.
@@ -2090,27 +2152,86 @@ ins_compl_add(str, len, fname, dir, flags)
compl_first_match = match;
compl_curr_match = match;
/*
* Find the longest common string if still doing that.
*/
if (compl_get_longest && (flags & ORIGINAL_TEXT) == 0)
ins_compl_longest_match(match);
return OK;
}
/*
* Reduce the longest common string for match "match".
*/
static void
ins_compl_longest_match(match)
compl_T *match;
{
char_u *p, *s;
int l;
int had_match;
if (compl_leader == NULL)
/* First match, use it as a whole. */
compl_leader = vim_strsave(match->cp_str);
else
{
/* Reduce the text if this match differs from compl_leader. */
for (p = compl_leader, s = match->cp_str; *p != NUL; p += l, s += l)
{
#ifdef FEAT_MBYTE
if (has_mbyte)
{
l = mb_ptr2len(p);
if (STRNCMP(p, s, l) != 0)
break;
}
else
#endif
{
if (*p != *s)
break;
l = 1;
}
}
if (*p != NUL)
{
/* Leader was shortened, need to change the inserted text. */
*p = NUL;
had_match = (curwin->w_cursor.col > compl_col);
ins_compl_delete();
ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
ins_redraw(FALSE);
/* When the match isn't there (to avoid matching itself) remove it
* again after redrawing. */
if (!had_match)
ins_compl_delete();
}
compl_used_match = FALSE;
}
}
/*
* Add an array of matches to the list of matches.
* 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 +2264,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;
/*
@@ -2184,7 +2305,7 @@ ins_compl_del_pum()
pum_wanted()
{
/* 'completeopt' must contain "menu" */
if (*p_cot == NUL)
if (vim_strchr(p_cot, 'm') == NULL)
return FALSE;
/* The display looks bad on a B&W display. */
@@ -2223,11 +2344,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 +2381,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 +2395,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 +2468,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 +2483,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 +2680,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 +2701,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 +2789,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.
@@ -2653,6 +2836,14 @@ ins_compl_prep(c)
if (c == K_SELECT)
return retval;
/* Set "compl_get_longest" when finding the first matches. */
if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET
|| (ctrl_x_mode == 0 && !compl_started))
{
compl_get_longest = (vim_strchr(p_cot, 'l') != NULL);
compl_used_match = TRUE;
}
if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET)
{
/*
@@ -2919,30 +3110,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 +3143,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 +3219,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 +3322,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 +3342,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 +3359,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 +3371,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 +3379,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 +3394,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 +3424,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)
@@ -3243,7 +3438,7 @@ ins_compl_get_exp(ini, dir)
last_match_pos = *pos;
}
else if (first_match_pos.lnum == last_match_pos.lnum
&& first_match_pos.col == last_match_pos.col)
&& first_match_pos.col == last_match_pos.col)
found_new_match = FAIL;
if (found_new_match == FAIL)
{
@@ -3335,7 +3530,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;
@@ -3357,9 +3552,10 @@ ins_compl_get_exp(ini, dir)
{
if (got_int)
break;
/* Fill the popup menu as soon as possible. */
if (pum_wanted() && type != -1)
/* Fill the popup menu as soon as possible. */
ins_compl_check_keys(0);
if ((ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE)
|| compl_interrupted)
break;
@@ -3388,7 +3584,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;
@@ -3434,10 +3630,11 @@ ins_compl_insert()
* calls this function with "allow_get_expansion" FALSE.
*/
static int
ins_compl_next(allow_get_expansion, count)
ins_compl_next(allow_get_expansion, count, insert_match)
int allow_get_expansion;
int count; /* repeat completion this many times; should
be at least 1 */
int insert_match; /* Insert the newly selected match */
{
int num_matches = -1;
int i;
@@ -3445,11 +3642,23 @@ ins_compl_next(allow_get_expansion, count)
compl_T *found_compl = NULL;
int found_end = FALSE;
if (allow_get_expansion)
if (compl_leader != NULL
&& (compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0)
{
/* Set "compl_shown_match" to the actually shown match, it may differ
* when "compl_leader" is used to omit some of the matches. */
while (STRNCMP(compl_shown_match->cp_str,
compl_leader, STRLEN(compl_leader)) != 0
&& compl_shown_match->cp_next != NULL
&& compl_shown_match->cp_next != compl_first_match)
compl_shown_match = compl_shown_match->cp_next;
}
if (allow_get_expansion && insert_match
&& (!compl_get_longest || compl_used_match))
/* Delete old text to be replaced */
ins_compl_delete();
}
compl_pending = FALSE;
/* Repeat this for when <PageUp> or <PageDown> is typed. But don't wrap
@@ -3476,7 +3685,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;
@@ -3502,14 +3711,25 @@ ins_compl_next(allow_get_expansion, count)
}
}
/* Insert the text of the new completion */
ins_compl_insert();
/* Insert the text of the new completion, or the compl_leader. */
if (insert_match)
{
if (!compl_get_longest || compl_used_match)
ins_compl_insert();
else
ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
}
else
compl_used_match = FALSE;
if (!allow_get_expansion)
{
/* may undisplay the popup menu first */
ins_compl_upd_pum();
/* redraw to show the user what was inserted */
update_screen(0);
/* display the updated popup menu */
ins_compl_show_pum();
@@ -3572,13 +3792,14 @@ ins_compl_check_keys(frequency)
{
c = safe_vgetc(); /* Eat the character */
compl_shows_dir = ins_compl_key2dir(c);
(void)ins_compl_next(FALSE, ins_compl_key2count(c));
(void)ins_compl_next(FALSE, ins_compl_key2count(c),
c != K_UP && c != K_DOWN);
}
else if (c != Ctrl_R)
compl_interrupted = TRUE;
}
if (compl_pending && !got_int)
(void)ins_compl_next(FALSE, 1);
(void)ins_compl_next(FALSE, 1, TRUE);
}
/*
@@ -3589,8 +3810,9 @@ ins_compl_check_keys(frequency)
ins_compl_key2dir(c)
int c;
{
if (c == Ctrl_P || c == Ctrl_L || (pum_visible()
&& (c == K_PAGEUP || c == K_KPAGEUP || c == K_S_UP)))
if (c == Ctrl_P || c == Ctrl_L
|| (pum_visible() && (c == K_PAGEUP || c == K_KPAGEUP
|| c == K_S_UP || c == K_UP)))
return BACKWARD;
return FORWARD;
}
@@ -3604,7 +3826,8 @@ ins_compl_pum_key(c)
int c;
{
return pum_visible() && (c == K_PAGEUP || c == K_KPAGEUP || c == K_S_UP
|| c == K_PAGEDOWN || c == K_KPAGEDOWN || c == K_S_DOWN);
|| c == K_PAGEDOWN || c == K_KPAGEDOWN || c == K_S_DOWN
|| c == K_UP || c == K_DOWN);
}
/*
@@ -3617,7 +3840,7 @@ ins_compl_key2count(c)
{
int h;
if (ins_compl_pum_key(c))
if (ins_compl_pum_key(c) && c != K_UP && c != K_DOWN)
{
h = pum_get_height();
if (h > 3)
@@ -3670,7 +3893,8 @@ ins_complete(c)
* been split because it was longer than 'tw'). if SOL is set then
* skip the previous pattern, a word at the beginning of the line has
* been inserted, we'll look for that -- Acevedo. */
if ((compl_cont_status & CONT_INTRPT) && compl_cont_mode == ctrl_x_mode)
if ((compl_cont_status & CONT_INTRPT) == CONT_INTRPT
&& compl_cont_mode == ctrl_x_mode)
{
/*
* it is a continued search
@@ -3992,7 +4216,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;
@@ -4016,9 +4240,10 @@ ins_complete(c)
compl_shows_dir = compl_direction;
/*
* Find next match.
* Find next match (and following matches).
*/
n = ins_compl_next(TRUE, ins_compl_key2count(c));
n = ins_compl_next(TRUE, ins_compl_key2count(c),
c != K_UP && c != K_DOWN);
/* may undisplay the popup menu */
ins_compl_upd_pum();
@@ -6557,7 +6782,7 @@ ins_reg()
if (redrawing() && !char_avail())
{
/* may need to redraw when no more chars available now */
ins_redraw();
ins_redraw(FALSE);
edit_putchar('"', TRUE);
#ifdef FEAT_CMDL_INFO
@@ -8229,7 +8454,7 @@ ins_digraph()
if (redrawing() && !char_avail())
{
/* may need to redraw when no more chars available now */
ins_redraw();
ins_redraw(FALSE);
edit_putchar('?', TRUE);
#ifdef FEAT_CMDL_INFO
@@ -8261,14 +8486,14 @@ ins_digraph()
if (redrawing() && !char_avail())
{
/* may need to redraw when no more chars available now */
ins_redraw();
ins_redraw(FALSE);
if (char2cells(c) == 1)
{
/* first remove the '?', otherwise it's restored when typing
* an ESC next */
edit_unputchar();
ins_redraw();
ins_redraw(FALSE);
edit_putchar(c, TRUE);
}
#ifdef FEAT_CMDL_INFO

View 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);
}
/*
@@ -15363,7 +15378,21 @@ var2fpos(varp, lnum)
return NULL;
return pp;
}
if (name[0] == '$') /* last column or line */
if (name[0] == 'w' && lnum)
{
pos.col = 0;
if (name[1] == '0') /* "w0": first visible line */
{
pos.lnum = curwin->w_topline;
return &pos;
}
else if (name[1] == '$') /* "w$": last visible line */
{
pos.lnum = curwin->w_botline - 1;
return &pos;
}
}
else if (name[0] == '$') /* last column or line */
{
if (lnum)
{

View File

@@ -497,6 +497,8 @@ EX(CMD_lchdir, "lchdir", ex_cd,
BANG|FILE1|TRLBAR|CMDWIN),
EX(CMD_lclose, "lclose", ex_cclose,
RANGE|NOTADR|COUNT|TRLBAR),
EX(CMD_lcscope, "lcscope", do_cscope,
EXTRA|NOTRLCOM|SBOXOK|XFILE),
EX(CMD_left, "left", ex_align,
TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
EX(CMD_leftabove, "leftabove", ex_wrongmodifier,
@@ -515,6 +517,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,

View File

@@ -65,7 +65,7 @@ static void msg_add_eol __ARGS((void));
static int check_mtime __ARGS((buf_T *buf, struct stat *s));
static int time_differs __ARGS((long t1, long t2));
#ifdef FEAT_AUTOCMD
static int apply_autocmds_exarg __ARGS((EVENT_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, exarg_T *eap));
static int apply_autocmds_exarg __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, exarg_T *eap));
#endif
#if defined(FEAT_CRYPT) || defined(FEAT_MBYTE)
@@ -6894,7 +6894,7 @@ typedef struct AutoPat
static struct event_name
{
char *name; /* event name */
EVENT_T event; /* event number */
event_T event; /* event number */
} event_names[] =
{
{"BufAdd", EVENT_BUFADD},
@@ -6922,9 +6922,12 @@ static struct event_name
{"CmdwinEnter", EVENT_CMDWINENTER},
{"CmdwinLeave", EVENT_CMDWINLEAVE},
{"ColorScheme", EVENT_COLORSCHEME},
{"CursorHold", EVENT_CURSORHOLD},
{"CursorHoldI", EVENT_CURSORHOLDI},
{"CursorMoved", EVENT_CURSORMOVED},
{"CursorMovedI", EVENT_CURSORMOVEDI},
{"EncodingChanged", EVENT_ENCODINGCHANGED},
{"FileEncoding", EVENT_ENCODINGCHANGED},
{"CursorHold", EVENT_CURSORHOLD},
{"FileAppendPost", EVENT_FILEAPPENDPOST},
{"FileAppendPre", EVENT_FILEAPPENDPRE},
{"FileAppendCmd", EVENT_FILEAPPENDCMD},
@@ -6966,7 +6969,7 @@ static struct event_name
{"VimLeavePre", EVENT_VIMLEAVEPRE},
{"WinEnter", EVENT_WINENTER},
{"WinLeave", EVENT_WINLEAVE},
{NULL, (EVENT_T)0}
{NULL, (event_T)0}
};
static AutoPat *first_autopat[NUM_EVENTS] =
@@ -6990,7 +6993,7 @@ typedef struct AutoPatCmd
char_u *fname; /* fname to match with */
char_u *sfname; /* sfname to match with */
char_u *tail; /* tail of fname */
EVENT_T event; /* current event */
event_T event; /* current event */
int arg_bufnr; /* initially equal to <abuf>, set to zero when
buf is deleted */
struct AutoPatCmd *next; /* chain of active apc-s for auto-invalidation*/
@@ -7014,25 +7017,25 @@ static int current_augroup = AUGROUP_DEFAULT;
static int au_need_clean = FALSE; /* need to delete marked patterns */
static void show_autocmd __ARGS((AutoPat *ap, EVENT_T event));
static void show_autocmd __ARGS((AutoPat *ap, event_T event));
static void au_remove_pat __ARGS((AutoPat *ap));
static void au_remove_cmds __ARGS((AutoPat *ap));
static void au_cleanup __ARGS((void));
static int au_new_group __ARGS((char_u *name));
static void au_del_group __ARGS((char_u *name));
static int au_find_group __ARGS((char_u *name));
static EVENT_T event_name2nr __ARGS((char_u *start, char_u **end));
static char_u *event_nr2name __ARGS((EVENT_T event));
static event_T event_name2nr __ARGS((char_u *start, char_u **end));
static char_u *event_nr2name __ARGS((event_T event));
static char_u *find_end_event __ARGS((char_u *arg, int have_group));
static int event_ignored __ARGS((EVENT_T event));
static int event_ignored __ARGS((event_T event));
static int au_get_grouparg __ARGS((char_u **argp));
static int do_autocmd_event __ARGS((EVENT_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group));
static int do_autocmd_event __ARGS((event_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group));
static char_u *getnextac __ARGS((int c, void *cookie, int indent));
static int apply_autocmds_group __ARGS((EVENT_T event, char_u *fname, char_u *fname_io, int force, int group, buf_T *buf, exarg_T *eap));
static int apply_autocmds_group __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, int group, buf_T *buf, exarg_T *eap));
static void auto_next_pat __ARGS((AutoPatCmd *apc, int stop_at_last));
static EVENT_T last_event;
static event_T last_event;
static int last_group;
/*
@@ -7041,7 +7044,7 @@ static int last_group;
static void
show_autocmd(ap, event)
AutoPat *ap;
EVENT_T event;
event_T event;
{
AutoCmd *ac;
@@ -7140,14 +7143,14 @@ au_cleanup()
{
AutoPat *ap, **prev_ap;
AutoCmd *ac, **prev_ac;
EVENT_T event;
event_T event;
if (autocmd_busy || !au_need_clean)
return;
/* loop over all events */
for (event = (EVENT_T)0; (int)event < (int)NUM_EVENTS;
event = (EVENT_T)((int)event + 1))
for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
event = (event_T)((int)event + 1))
{
/* loop over all autocommand patterns */
prev_ap = &(first_autopat[(int)event]);
@@ -7193,7 +7196,7 @@ aubuflocal_remove(buf)
buf_T *buf;
{
AutoPat *ap;
EVENT_T event;
event_T event;
AutoPatCmd *apc;
/* invalidate currently executing autocommands */
@@ -7202,8 +7205,8 @@ aubuflocal_remove(buf)
apc->arg_bufnr = 0;
/* invalidate buflocals looping through events */
for (event = (EVENT_T)0; (int)event < (int)NUM_EVENTS;
event = (EVENT_T)((int)event + 1))
for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
event = (event_T)((int)event + 1))
/* loop over all autocommand patterns */
for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next)
if (ap->buflocal_nr == buf->b_fnum)
@@ -7352,7 +7355,7 @@ free_all_autocmds()
* Return NUM_EVENTS if the event name was not found.
* Return a pointer to the next event name in "end".
*/
static EVENT_T
static event_T
event_name2nr(start, end)
char_u *start;
char_u **end;
@@ -7383,7 +7386,7 @@ event_name2nr(start, end)
*/
static char_u *
event_nr2name(event)
EVENT_T event;
event_T event;
{
int i;
@@ -7435,7 +7438,7 @@ find_end_event(arg, have_group)
*/
static int
event_ignored(event)
EVENT_T event;
event_T event;
{
char_u *p = p_ei;
@@ -7547,7 +7550,7 @@ do_autocmd(arg, forceit)
char_u *pat;
char_u *envpat = NULL;
char_u *cmd;
EVENT_T event;
event_T event;
int need_free = FALSE;
int nested = FALSE;
int group;
@@ -7628,12 +7631,12 @@ do_autocmd(arg, forceit)
/*
* Loop over the events.
*/
last_event = (EVENT_T)-1; /* for listing the event name */
last_event = (event_T)-1; /* for listing the event name */
last_group = AUGROUP_ERROR; /* for listing the group name */
if (*arg == '*' || *arg == NUL)
{
for (event = (EVENT_T)0; (int)event < (int)NUM_EVENTS;
event = (EVENT_T)((int)event + 1))
for (event = (event_T)0; (int)event < (int)NUM_EVENTS;
event = (event_T)((int)event + 1))
if (do_autocmd_event(event, pat,
nested, cmd, forceit, group) == FAIL)
break;
@@ -7691,7 +7694,7 @@ au_get_grouparg(argp)
*/
static int
do_autocmd_event(event, pat, nested, cmd, forceit, group)
EVENT_T event;
event_T event;
char_u *pat;
int nested;
char_u *cmd;
@@ -8162,7 +8165,7 @@ static int autocmd_nested = FALSE;
*/
int
apply_autocmds(event, fname, fname_io, force, buf)
EVENT_T event;
event_T event;
char_u *fname; /* NULL or empty means use actual file name */
char_u *fname_io; /* fname to use for <afile> on cmdline */
int force; /* when TRUE, ignore autocmd_busy */
@@ -8178,7 +8181,7 @@ apply_autocmds(event, fname, fname_io, force, buf)
*/
static int
apply_autocmds_exarg(event, fname, fname_io, force, buf, eap)
EVENT_T event;
event_T event;
char_u *fname;
char_u *fname_io;
int force;
@@ -8197,7 +8200,7 @@ apply_autocmds_exarg(event, fname, fname_io, force, buf, eap)
*/
int
apply_autocmds_retval(event, fname, fname_io, force, buf, retval)
EVENT_T event;
event_T event;
char_u *fname; /* NULL or empty means use actual file name */
char_u *fname_io; /* fname to use for <afile> on cmdline */
int force; /* when TRUE, ignore autocmd_busy */
@@ -8222,14 +8225,14 @@ apply_autocmds_retval(event, fname, fname_io, force, buf, retval)
return did_cmd;
}
#if defined(FEAT_AUTOCMD) || defined(PROTO)
/*
* Return TRUE when there is a CursorHold autocommand defined.
*/
int
has_cursorhold()
{
return (first_autopat[(int)EVENT_CURSORHOLD] != NULL);
return (first_autopat[(int)(get_real_state() == NORMAL_BUSY
? EVENT_CURSORHOLD : EVENT_CURSORHOLDI)] != NULL);
}
/*
@@ -8238,16 +8241,38 @@ has_cursorhold()
int
trigger_cursorhold()
{
return (!did_cursorhold
&& has_cursorhold()
&& !Recording
&& get_real_state() == NORMAL_BUSY);
int state;
if (!did_cursorhold && has_cursorhold() && !Recording)
{
state = get_real_state();
if (state == NORMAL_BUSY || (state & INSERT) != 0)
return TRUE;
}
return FALSE;
}
/*
* Return TRUE when there is a CursorMoved autocommand defined.
*/
int
has_cursormoved()
{
return (first_autopat[(int)EVENT_CURSORMOVED] != NULL);
}
/*
* Return TRUE when there is a CursorMovedI autocommand defined.
*/
int
has_cursormovedI()
{
return (first_autopat[(int)EVENT_CURSORMOVEDI] != NULL);
}
#endif
static int
apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
EVENT_T event;
event_T event;
char_u *fname; /* NULL or empty means use actual file name */
char_u *fname_io; /* fname to use for <afile> on cmdline, NULL means
use fname */
@@ -8735,7 +8760,7 @@ getnextac(c, cookie, indent)
*/
int
has_autocmd(event, sfname, buf)
EVENT_T event;
event_T event;
char_u *sfname;
buf_T *buf;
{
@@ -8902,7 +8927,7 @@ au_exists(arg)
char_u *pattern = NULL;
char_u *event_name;
char_u *p;
EVENT_T event;
event_T event;
AutoPat *ap;
buf_T *buflocal_buf = NULL;
int group;

View File

@@ -1534,7 +1534,7 @@ vgetc()
continue;
}
#endif
#if defined(HAVE_GTK2) && defined(FEAT_MENU)
#if defined(FEAT_GUI) && defined(HAVE_GTK2) && defined(FEAT_MENU)
/* GTK: <F10> normally selects the menu, but it's passed until
* here to allow mapping it. Intercept and invoke the GTK
* behavior if it's not mapped. */

View File

@@ -781,8 +781,10 @@ EXTERN int xim_changed_while_preediting INIT(= FALSE);
# else
EXTERN XIC xic INIT(= NULL);
# endif
# ifdef FEAT_GUI
EXTERN guicolor_T xim_fg_color INIT(= INVALCOLOR);
EXTERN guicolor_T xim_bg_color INIT(= INVALCOLOR);
# endif
#endif
#ifdef FEAT_HANGULIN
@@ -952,7 +954,12 @@ EXTERN char_u *new_last_cmdline INIT(= NULL); /* new value for last_cmdline */
EXTERN char_u *autocmd_fname INIT(= NULL); /* fname for <afile> on cmdline */
EXTERN int autocmd_bufnr INIT(= 0); /* fnum for <abuf> on cmdline */
EXTERN char_u *autocmd_match INIT(= NULL); /* name for <amatch> on cmdline */
EXTERN int did_cursorhold INIT(= FALSE); /* set when CursorHold triggered */
EXTERN int did_cursorhold INIT(= FALSE); /* set when CursorHold t'gerd */
EXTERN pos_T last_cursormoved /* for CursorMoved event */
# ifdef DO_INIT
= INIT_POS_T
# endif
;
#endif
EXTERN linenr_T write_no_eol_lnum INIT(= 0); /* non-zero lnum when last line

View File

@@ -3055,7 +3055,7 @@ gui_xy2colrow(x, y, colp)
gui_menu_cb(menu)
vimmenu_T *menu;
{
char_u bytes[3 + sizeof(long_u)];
char_u bytes[sizeof(long_u)];
/* Don't put events in the input queue now. */
if (hold_gui_events)
@@ -3064,8 +3064,9 @@ gui_menu_cb(menu)
bytes[0] = CSI;
bytes[1] = KS_MENU;
bytes[2] = KE_FILLER;
add_long_to_buf((long_u)menu, bytes + 3);
add_to_input_buf(bytes, 3 + sizeof(long_u));
add_to_input_buf(bytes, 3);
add_long_to_buf((long_u)menu, bytes);
add_to_input_buf_csi(bytes, sizeof(long_u));
}
#endif
@@ -3358,7 +3359,7 @@ gui_drag_scrollbar(sb, value, still_dragging)
int old_topfill = curwin->w_topfill;
# endif
#else
char_u bytes[4 + sizeof(long_u)];
char_u bytes[sizeof(long_u)];
int byte_count;
#endif
@@ -3528,8 +3529,9 @@ gui_drag_scrollbar(sb, value, still_dragging)
out_flush();
gui_update_cursor(FALSE, TRUE);
#else
add_long_to_buf((long)value, bytes + byte_count);
add_to_input_buf(bytes, byte_count + sizeof(long_u));
add_to_input_buf(bytes, byte_count);
add_long_to_buf((long_u)value, bytes);
add_to_input_buf_csi(bytes, sizeof(long_u));
#endif
}

View File

@@ -50,7 +50,7 @@ static void cs_file_results __ARGS((FILE *, int *));
static void cs_fill_results __ARGS((char *, int , int *, char ***,
char ***, int *));
static int cs_find __ARGS((exarg_T *eap));
static int cs_find_common __ARGS((char *opt, char *pat, int, int ));
static int cs_find_common __ARGS((char *opt, char *pat, int, int, int));
static int cs_help __ARGS((exarg_T *eap));
static void cs_init __ARGS((void));
static void clear_csinfo __ARGS((int i));
@@ -183,7 +183,8 @@ do_cstag(eap)
case 0 :
if (cs_check_for_connections())
{
ret = cs_find_common("g", (char *)(eap->arg), eap->forceit, FALSE);
ret = cs_find_common("g", (char *)(eap->arg), eap->forceit, FALSE,
FALSE);
if (ret == FALSE)
{
cs_free_tags();
@@ -211,7 +212,7 @@ do_cstag(eap)
if (cs_check_for_connections())
{
ret = cs_find_common("g", (char *)(eap->arg), eap->forceit,
FALSE);
FALSE, FALSE);
if (ret == FALSE)
cs_free_tags();
}
@@ -219,7 +220,8 @@ do_cstag(eap)
}
else if (cs_check_for_connections())
{
ret = cs_find_common("g", (char *)(eap->arg), eap->forceit, FALSE);
ret = cs_find_common("g", (char *)(eap->arg), eap->forceit, FALSE,
FALSE);
if (ret == FALSE)
cs_free_tags();
}
@@ -967,7 +969,8 @@ cs_find(eap)
return FALSE;
}
return cs_find_common(opt, pat, eap->forceit, TRUE);
return cs_find_common(opt, pat, eap->forceit, TRUE,
eap->cmdidx == CMD_lcscope);
} /* cs_find */
@@ -977,11 +980,12 @@ cs_find(eap)
* common code for cscope find, shared by cs_find() and do_cstag()
*/
static int
cs_find_common(opt, pat, forceit, verbose)
cs_find_common(opt, pat, forceit, verbose, use_ll)
char *opt;
char *pat;
int forceit;
int verbose;
int use_ll;
{
int i;
char *cmd;
@@ -1099,12 +1103,16 @@ cs_find_common(opt, pat, forceit, verbose)
/* fill error list */
FILE *f;
char_u *tmp = vim_tempname('c');
qf_info_T *qi = NULL;
win_T *wp = NULL;
f = mch_fopen((char *)tmp, "w");
cs_file_results(f, nummatches);
fclose(f);
if (use_ll) /* Use location list */
wp = curwin;
/* '-' starts a new error list */
if (qf_init(NULL, tmp, (char_u *)"%f%*\\t%l%*\\t%m", *qfpos == '-') > 0)
if (qf_init(wp, tmp, (char_u *)"%f%*\\t%l%*\\t%m", *qfpos == '-') > 0)
{
# ifdef FEAT_WINDOWS
if (postponed_split != 0)
@@ -1117,7 +1125,14 @@ cs_find_common(opt, pat, forceit, verbose)
postponed_split = 0;
}
# endif
qf_jump(NULL, 0, 0, forceit);
if (use_ll)
/*
* In the location list window, use the displayed location
* list. Otherwise, use the location list for the window.
*/
qi = (bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL) ?
wp->w_llist_ref : wp->w_llist;
qf_jump(qi, 0, 0, forceit);
}
mch_remove(tmp);
vim_free(tmp);

View File

@@ -31,7 +31,7 @@
# Move configure aside, autoconf would overwrite it
:move {exist} configure configure.save
:sys autoconf
:cat configure | :eval re.sub('\\./config.log', 'auto/config.log', stdin) >! auto/configure
:cat configure | :eval re.sub('\\./config.log', 'auto/config.log', stdin) | :eval re.sub('>config.log', '>auto/config.log', stdin) >! auto/configure
:chmod 755 auto/configure
:move configure.save configure
:del {force} auto/config.cache auto/config.status

View File

@@ -988,6 +988,17 @@ main_loop(cmdwin, noexmode)
skip_redraw = FALSE;
else if (do_redraw || stuff_empty())
{
#ifdef FEAT_AUTOCMD
/* Trigger CursorMoved if the cursor moved. */
if (!finish_op && has_cursormoved()
&& !equalpos(last_cursormoved, curwin->w_cursor))
{
apply_autocmds(EVENT_CURSORMOVED, NULL, NULL, FALSE, curbuf);
last_cursormoved = curwin->w_cursor;
}
#endif
#if defined(FEAT_DIFF) && defined(FEAT_SCROLLBIND)
/* Scroll-binding for diff mode may have been postponed until
* here. Avoids doing it for every change. */

View File

@@ -100,7 +100,7 @@
#include <X11/Xlocale.h>
#endif
#if defined(FEAT_XIM) && defined(HAVE_GTK2)
#if defined(FEAT_GUI_GTK) && defined(FEAT_XIM) && defined(HAVE_GTK2)
# include <gdk/gdkkeysyms.h>
# ifdef WIN3264
# include <gdk/gdkwin32.h>

View 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.
*/

View File

@@ -3635,10 +3635,10 @@ add_to_showcmd(c)
int i;
static int ignore[] =
{
#ifdef FEAT_GUI
# ifdef FEAT_GUI
K_VER_SCROLLBAR, K_HOR_SCROLLBAR,
K_LEFTMOUSE_NM, K_LEFTRELEASE_NM,
#endif
# endif
K_IGNORE,
K_LEFTMOUSE, K_LEFTDRAG, K_LEFTRELEASE,
K_MIDDLEMOUSE, K_MIDDLEDRAG, K_MIDDLERELEASE,

View File

@@ -2628,7 +2628,7 @@ static char *(p_fdm_values[]) = {"manual", "expr", "marker", "indent", "syntax",
static char *(p_fcl_values[]) = {"all", NULL};
#endif
#ifdef FEAT_INS_EXPAND
static char *(p_cot_values[]) = {"menu", NULL};
static char *(p_cot_values[]) = {"menu", "longest", NULL};
#endif
static void set_option_default __ARGS((int, int opt_flags, int compatible));

View File

@@ -302,7 +302,7 @@
#define LISPWORD_VALUE "defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do*,define-syntax,let-syntax,letrec-syntax,destructuring-bind,defpackage,defparameter,defstruct,deftype,defvar,do-all-symbols,do-external-symbols,do-symbols,dolist,dotimes,ecase,etypecase,eval-when,labels,macrolet,multiple-value-bind,multiple-value-call,multiple-value-prog1,multiple-value-setq,prog1,progv,typecase,unless,unwind-protect,when,with-input-from-string,with-open-file,with-open-stream,with-output-to-string,with-package-iterator,define-condition,handler-bind,handler-case,restart-bind,restart-case,with-simple-restart,store-value,use-value,muffle-warning,abort,continue,with-slots,with-slots*,with-accessors,with-accessors*,defclass,defmethod,print-unreadable-object"
/*
* The following are actual variabables for the options
* The following are actual variables for the options
*/
#ifdef FEAT_RIGHTLEFT

View File

@@ -14,13 +14,14 @@
#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 (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;
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;
/* 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);

View 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));

View 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));

View File

@@ -33,11 +33,13 @@ int do_doautocmd __ARGS((char_u *arg, int do_msg));
void ex_doautoall __ARGS((exarg_T *eap));
void aucmd_prepbuf __ARGS((aco_save_T *aco, buf_T *buf));
void aucmd_restbuf __ARGS((aco_save_T *aco));
int apply_autocmds __ARGS((EVENT_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf));
int apply_autocmds_retval __ARGS((EVENT_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, int *retval));
int apply_autocmds __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf));
int apply_autocmds_retval __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, int *retval));
int has_cursorhold __ARGS((void));
int trigger_cursorhold __ARGS((void));
int has_autocmd __ARGS((EVENT_T event, char_u *sfname, buf_T *buf));
int has_cursormoved __ARGS((void));
int has_cursormovedI __ARGS((void));
int has_autocmd __ARGS((event_T event, char_u *sfname, buf_T *buf));
char_u *get_augroup_name __ARGS((expand_T *xp, int idx));
char_u *set_context_in_autocmd __ARGS((expand_T *xp, char_u *arg, int doautocmd));
char_u *get_event_name __ARGS((expand_T *xp, int idx));

View 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));

View 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 : */

View File

@@ -125,6 +125,7 @@ static char_u *get_mef_name __ARGS((void));
static buf_T *load_dummy_buffer __ARGS((char_u *fname));
static void wipe_dummy_buffer __ARGS((buf_T *buf));
static void unload_dummy_buffer __ARGS((buf_T *buf));
static qf_info_T *ll_get_or_alloc_list __ARGS((win_T *));
/* Quickfix window check helper macro */
#define IS_QF_WINDOW(wp) (bt_quickfix(wp->w_buffer) && wp->w_llist_ref == NULL)
@@ -154,7 +155,11 @@ qf_init(wp, efile, errorformat, newlist)
return FAIL;
if (wp != NULL)
qi = GET_LOC_LIST(wp);
{
qi = ll_get_or_alloc_list(wp);
if (qi == NULL)
return FAIL;
}
return qf_init_ext(qi, efile, curbuf, NULL, errorformat, newlist,
(linenr_T)0, (linenr_T)0);
@@ -954,19 +959,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 +995,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 +1024,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 +1338,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 +1373,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 +1500,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)
@@ -2566,8 +2580,10 @@ buf_hide(buf)
grep_internal(cmdidx)
cmdidx_T cmdidx;
{
return ((cmdidx == CMD_grep || cmdidx == CMD_lgrep
|| cmdidx == CMD_grepadd || cmdidx == CMD_lgrepadd)
return ((cmdidx == CMD_grep
|| cmdidx == CMD_lgrep
|| cmdidx == CMD_grepadd
|| cmdidx == CMD_lgrepadd)
&& STRCMP("internal",
*curbuf->b_p_gp == NUL ? p_gp : curbuf->b_p_gp) == 0);
}
@@ -2583,18 +2599,18 @@ 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;
switch (eap->cmdidx)
{
case CMD_make: au_name = (char_u *)"make"; break;
case CMD_lmake: au_name = (char_u *)"lmake"; break;
case CMD_grep: au_name = (char_u *)"grep"; break;
case CMD_lgrep: au_name = (char_u *)"lgrep"; break;
case CMD_grepadd: au_name = (char_u *)"grepadd"; break;
case CMD_lgrepadd: au_name = (char_u *)"lgrepadd"; break;
case CMD_make: au_name = (char_u *)"make"; break;
case CMD_lmake: au_name = (char_u *)"lmake"; break;
case CMD_grep: au_name = (char_u *)"grep"; break;
case CMD_lgrep: au_name = (char_u *)"lgrep"; break;
case CMD_grepadd: au_name = (char_u *)"grepadd"; break;
case CMD_lgrepadd: au_name = (char_u *)"lgrepadd"; break;
default: break;
}
if (au_name != NULL)
@@ -2617,12 +2633,7 @@ ex_make(eap)
if (eap->cmdidx == CMD_lmake || eap->cmdidx == CMD_lgrep
|| eap->cmdidx == CMD_lgrepadd)
{
qi = ll_get_or_alloc_list(curwin);
if (qi == NULL)
return;
wp = curwin;
}
autowrite_all();
fname = get_mef_name();
@@ -2667,7 +2678,11 @@ ex_make(eap)
(eap->cmdidx != CMD_grepadd
&& eap->cmdidx != CMD_lgrepadd)) > 0
&& !eap->forceit)
qf_jump(wp, 0, 0, FALSE); /* display first error */
{
if (wp != NULL)
qi = GET_LOC_LIST(wp);
qf_jump(qi, 0, 0, FALSE); /* display first error */
}
mch_remove(fname);
vim_free(fname);
@@ -2745,11 +2760,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 +2773,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 +2795,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 +2810,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,16 +2832,11 @@ 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)
{
qi = ll_get_or_alloc_list(curwin);
if (qi == NULL)
return;
wp = curwin;
}
if (*eap->arg != NUL)
set_string_option_direct((char_u *)"ef", -1, eap->arg, OPT_FREE);
@@ -2844,7 +2855,11 @@ 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 */
{
if (wp != NULL)
qi = GET_LOC_LIST(wp);
qf_jump(qi, 0, 0, eap->forceit); /* display first error */
}
}
/*
@@ -2865,7 +2880,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 +2913,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_lgrep
|| 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 // */
@@ -2929,7 +2944,7 @@ ex_vimgrep(eap)
goto theend;
}
if ((eap->cmdidx != CMD_grepadd && eap->cmdidx != CMD_lgrepadd &&
if ((eap->cmdidx != CMD_grepadd && eap->cmdidx != CMD_lgrepadd &&
eap->cmdidx != CMD_vimgrepadd && eap->cmdidx != CMD_lvimgrepadd)
|| qi->qf_curlist == qi->qf_listcount)
/* make place for a new list */
@@ -3105,7 +3120,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 +3391,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 *)"");
@@ -3466,10 +3481,15 @@ ex_cbuffer(eap)
|| eap->line2 < 1 || eap->line2 > buf->b_ml.ml_line_count)
EMSG(_(e_invrange));
else
qf_init_ext(qi, NULL, buf, NULL, p_efm,
(eap->cmdidx == CMD_cbuffer
|| eap->cmdidx == CMD_lbuffer),
eap->line1, eap->line2);
{
int buffer_cmd = (eap->cmdidx == CMD_cbuffer
|| eap->cmdidx == CMD_lbuffer);
if (qf_init_ext(qi, NULL, buf, NULL, p_efm, buffer_cmd,
eap->line1, eap->line2) > 0
&& buffer_cmd)
qf_jump(qi, 0, 0, eap->forceit); /* display first error */
}
}
}
@@ -3484,14 +3504,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
@@ -3502,12 +3520,12 @@ ex_cexpr(eap)
if ((tv->v_type == VAR_STRING && tv->vval.v_string != NULL)
|| (tv->v_type == VAR_LIST && tv->vval.v_list != NULL))
{
if (qf_init_ext(qi, NULL, NULL, tv, p_efm,
(eap->cmdidx == CMD_cexpr
|| eap->cmdidx == CMD_lexpr),
int expr_cmd = (eap->cmdidx == CMD_cexpr
|| eap->cmdidx == CMD_lexpr);
if (qf_init_ext(qi, NULL, NULL, tv, p_efm, expr_cmd,
(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 */
&& expr_cmd)
qf_jump(qi, 0, 0, eap->forceit); /* display first error */
}
else
EMSG(_("E777: String or List expected"));
@@ -3536,6 +3554,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 +3566,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 +3676,22 @@ 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 */

View 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;

View File

@@ -1593,7 +1593,10 @@ set_input_buf(p)
#if defined(FEAT_GUI) || defined(FEAT_MOUSE_GPM) \
|| defined(FEAT_XCLIPBOARD) || defined(VMS) \
|| defined(FEAT_SNIFF) || defined(FEAT_CLIENTSERVER) || defined(PROTO)
|| defined(FEAT_SNIFF) || defined(FEAT_CLIENTSERVER) \
|| (defined(FEAT_GUI) && (!defined(USE_ON_FLY_SCROLL) \
|| defined(FEAT_MENU))) \
|| defined(PROTO)
/*
* Add the given bytes to the input buffer
* Special keys start with CSI. A real CSI must have been translated to
@@ -1620,6 +1623,8 @@ add_to_input_buf(s, len)
#if (defined(FEAT_XIM) && defined(FEAT_GUI_GTK)) \
|| (defined(FEAT_MBYTE) && defined(FEAT_MBYTE_IME)) \
|| (defined(FEAT_GUI) && (!defined(USE_ON_FLY_SCROLL) \
|| defined(FEAT_MENU))) \
|| defined(PROTO)
/*
* Add "str[len]" to the input buffer while escaping CSI bytes.

View 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 10)"
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 10, compiled "

View File

@@ -1102,14 +1102,17 @@ enum auto_event
EVENT_WINLEAVE, /* before leaving a window */
EVENT_ENCODINGCHANGED, /* after changing the 'encoding' option */
EVENT_CURSORHOLD, /* cursor in same position for a while */
EVENT_CURSORHOLDI, /* idem, in Insert mode */
EVENT_FUNCUNDEFINED, /* if calling a function which doesn't exist */
EVENT_REMOTEREPLY, /* upon string reception from a remote vim */
EVENT_SWAPEXISTS, /* found existing swap file */
EVENT_SPELLFILEMISSING, /* spell file missing */
EVENT_CURSORMOVED, /* cursor was moved */
EVENT_CURSORMOVEDI, /* cursor was moved in Insert mode */
NUM_EVENTS /* MUST be the last one */
};
typedef enum auto_event EVENT_T;
typedef enum auto_event event_T;
/*
* Values for index in highlight_attr[].