updated for version 7.0217

This commit is contained in:
Bram Moolenaar
2006-03-07 22:38:47 +00:00
parent a203182302
commit 1f35bf9cab
22 changed files with 283 additions and 180 deletions

View File

@ -1,7 +1,7 @@
" Vim completion script
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2006 Feb 10
" Last Change: 2006 Mar 07
" This function is used for the 'omnifunc' option.
@ -123,7 +123,7 @@ function! ccomplete#Complete(findstart, base)
if match(line, match . '\s*\[') > 0
let match .= '['
else
let res = s:Nextitem(strpart(line, 0, col), [''], 0)
let res = s:Nextitem(strpart(line, 0, col), [''], 0, 1)
if len(res) > 0
" There are members, thus add "." or "->".
if match(line, '\*[ \t(]*' . match . '\>') > 0
@ -136,7 +136,7 @@ function! ccomplete#Complete(findstart, base)
let res = [{'match': match, 'tagline' : ''}]
else
" Completing "var.", "var.something", etc.
let res = s:Nextitem(strpart(line, 0, col), items[1:], 0)
let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1)
endif
endif
@ -153,7 +153,7 @@ function! ccomplete#Complete(findstart, base)
for i in range(len(diclist))
" New ctags has the "typename" field.
if has_key(diclist[i], 'typename')
call extend(res, s:StructMembers(diclist[i]['typename'], items[1:]))
call extend(res, s:StructMembers(diclist[i]['typename'], items[1:], 1))
endif
" For a variable use the command, which must be a search pattern that
@ -162,7 +162,7 @@ function! ccomplete#Complete(findstart, base)
let line = diclist[i]['cmd']
if line[0] == '/' && line[1] == '^'
let col = match(line, '\<' . items[0] . '\>')
call extend(res, s:Nextitem(strpart(line, 2, col - 2), items[1:], 0))
call extend(res, s:Nextitem(strpart(line, 2, col - 2), items[1:], 0, 1))
endif
endif
endfor
@ -173,7 +173,7 @@ function! ccomplete#Complete(findstart, base)
" TODO: join previous line if it makes sense
let line = getline('.')
let col = col('.')
let res = s:Nextitem(strpart(line, 0, col), items[1:], 0)
let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1)
endif
" If the last item(s) are [...] they need to be added to the matches.
@ -197,7 +197,7 @@ function! s:GetAddition(line, match, memarg, bracket)
endif
" Check if the item has members.
if len(s:SearchMembers(a:memarg, [''])) > 0
if len(s:SearchMembers(a:memarg, [''], 0)) > 0
" If there is a '*' before the name use "->".
if match(a:line, '\*[ \t(]*' . a:match . '\>') > 0
return '->'
@ -248,8 +248,8 @@ endfunction
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 = matchstr(a:cmd, '^/^\s*\zs.*\ze$/')
let x = substitute(x, '\<' . a:name . '\>', '@@', '')
let x = substitute(x, '\\\(.\)', '\1', 'g')
let x = x . ' - ' . a:fname
elseif a:cmd =~ '^\d*$'
@ -266,7 +266,7 @@ endfunction
" Repeat this recursively for items[1], if it's there.
" When resolving typedefs "depth" is used to avoid infinite recursion.
" Return the list of matches.
function! s:Nextitem(lead, items, depth)
function! s:Nextitem(lead, items, depth, all)
" Use the text up to the variable name and split it in tokens.
let tokens = split(a:lead, '\s\+\|\<')
@ -277,7 +277,7 @@ function! s:Nextitem(lead, items, depth)
" Recognize "struct foobar" and "union foobar".
if (tokens[tidx] == 'struct' || tokens[tidx] == 'union') && tidx + 1 < len(tokens)
let res = s:StructMembers(tokens[tidx] . ':' . tokens[tidx + 1], a:items)
let res = s:StructMembers(tokens[tidx] . ':' . tokens[tidx + 1], a:items, a:all)
break
endif
@ -291,7 +291,7 @@ function! s:Nextitem(lead, items, depth)
for tagidx in range(len(diclist))
" New ctags has the "typename" field.
if has_key(diclist[tagidx], 'typename')
call extend(res, s:StructMembers(diclist[tagidx]['typename'], a:items))
call extend(res, s:StructMembers(diclist[tagidx]['typename'], a:items, a:all))
continue
endif
@ -317,11 +317,11 @@ function! s:Nextitem(lead, items, depth)
endif
endfor
if name != ''
call extend(res, s:StructMembers(cmdtokens[0] . ':' . name, a:items))
call extend(res, s:StructMembers(cmdtokens[0] . ':' . name, a:items, a:all))
endif
elseif a:depth < 10
" Could be "typedef other_T some_T".
call extend(res, s:Nextitem(cmdtokens[0], a:items, a:depth + 1))
call extend(res, s:Nextitem(cmdtokens[0], a:items, a:depth + 1, a:all))
endif
endif
endif
@ -338,7 +338,9 @@ endfunction
" Search for members of structure "typename" in tags files.
" Return a list with resulting matches.
" Each match is a dictionary with "match" and "tagline" entries.
function! s:StructMembers(typename, items)
" When "all" is non-zero find all, otherwise just return 1 if there is any
" member.
function! s:StructMembers(typename, items, all)
" Todo: What about local structures?
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
if fnames == ''
@ -347,8 +349,13 @@ function! s:StructMembers(typename, items)
let typename = a:typename
let qflist = []
if a:all == 0
let n = '1' " stop at first found match
else
let n = ''
endif
while 1
exe 'silent! vimgrep /\t' . typename . '\(\t\|$\)/j ' . fnames
exe 'silent! ' . n . 'vimgrep /\t' . typename . '\(\t\|$\)/j ' . fnames
let qflist = getqflist()
if len(qflist) > 0 || match(typename, "::") < 0
break
@ -380,7 +387,7 @@ function! s:StructMembers(typename, items)
" More items following. For each of the possible members find the
" matching following members.
return s:SearchMembers(matches, a:items[idx :])
return s:SearchMembers(matches, a:items[idx :], a:all)
endif
" Failed to find anything.
@ -388,7 +395,9 @@ function! s:StructMembers(typename, items)
endfunction
" For matching members, find matches for following items.
function! s:SearchMembers(matches, items)
" When "all" is non-zero find all, otherwise just return 1 if there is any
" member.
function! s:SearchMembers(matches, items, all)
let res = []
for i in range(len(a:matches))
let typename = ''
@ -405,18 +414,22 @@ function! s:SearchMembers(matches, items)
let typename = matchstr(line, '[^\t]*', e)
endif
endif
if typename != ''
call extend(res, s:StructMembers(typename, a:items))
call extend(res, s:StructMembers(typename, a:items, a:all))
else
" Use the search command (the declaration itself).
let s = match(line, '\t\zs/^')
if s > 0
let e = match(line, '\<' . a:matches[i]['match'] . '\>', s)
if e > 0
call extend(res, s:Nextitem(strpart(line, s, e - s), a:items, 0))
call extend(res, s:Nextitem(strpart(line, s, e - s), a:items, 0, a:all))
endif
endif
endif
if a:all == 0 && len(res) > 0
break
endif
endfor
return res
endfunc

View File

@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Feb 27
*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Mar 07
VIM REFERENCE MANUAL by Bram Moolenaar
@ -274,6 +274,7 @@ Name triggered by ~
|FuncUndefined| a user function is used but it isn't defined
|SpellFileMissing| a spell file is used but it can't be found
|SourcePre| before sourcing a Vim script
|FocusGained| Vim got input focus
|FocusLost| Vim lost input focus
@ -666,6 +667,8 @@ RemoteReply When a reply from a Vim that functions as
*SessionLoadPost*
SessionLoadPost After loading the session file created using
the |:mksession| command.
*SourcePre*
SourcePre Before sourcing a Vim script. |:source|
*SpellFileMissing*
SpellFileMissing When trying to load a spell checking file and
it can't be found. <amatch> is the language,

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.0aa. Last change: 2006 Mar 06
*eval.txt* For Vim version 7.0aa. Last change: 2006 Mar 07
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1429,6 +1429,7 @@ v:swapcommand Normal mode command to be executed after a file has been
opened. Can be used for a |SwapExists| autocommand to have
another Vim open the file and jump to the right place. For
example, when jumping to a tag the value is ":tag tagname\r".
For ":edit +cmd file" the value is ":cmd\r".
*v:termresponse* *termresponse-variable*
v:termresponse The escape sequence returned by the terminal for the |t_RV|

View File

@ -1,4 +1,4 @@
*quickfix.txt* For Vim version 7.0aa. Last change: 2006 Feb 04
*quickfix.txt* For Vim version 7.0aa. Last change: 2006 Mar 07
VIM REFERENCE MANUAL by Bram Moolenaar
@ -499,6 +499,12 @@ advantages are:
pattern to ignore case or |/\C| to match case.
'smartcase' is not used.
When a number is put before the command this is used
as the maximum number of matches to find. Use
":1vimgrep pattern file" to find only the first.
Useful if you only want to check if there is a match
and quit quickly when it's found.
Without the 'j' flag Vim jumps to the first match.
With 'j' only the quickfix list is updated.
With the [!] any changes in the current buffer are

View File

@ -1,4 +1,4 @@
*repeat.txt* For Vim version 7.0aa. Last change: 2005 Jun 26
*repeat.txt* For Vim version 7.0aa. Last change: 2006 Mar 07
VIM REFERENCE MANUAL by Bram Moolenaar
@ -144,6 +144,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
*:so* *:source* *load-vim-script*
:so[urce] {file} Read Ex commands from {file}. These are commands that
start with a ":".
Triggers the |SourcePre| autocommand.
:so[urce]! {file} Read Vim commands from {file}. These are commands
that are executed from Normal mode, like you type

View File

@ -4123,6 +4123,7 @@ Select-mode-mapping visual.txt /*Select-mode-mapping*
Session starting.txt /*Session*
SessionLoad-variable starting.txt /*SessionLoad-variable*
SessionLoadPost autocmd.txt /*SessionLoadPost*
SourcePre autocmd.txt /*SourcePre*
SpellFileMissing autocmd.txt /*SpellFileMissing*
StdinReadPost autocmd.txt /*StdinReadPost*
StdinReadPre autocmd.txt /*StdinReadPre*
@ -5483,7 +5484,6 @@ hebrew hebrew.txt /*hebrew*
hebrew.txt hebrew.txt /*hebrew.txt*
help various.txt /*help*
help-context help.txt /*help-context*
help-tags tags 1
help-translated various.txt /*help-translated*
help-xterm-window various.txt /*help-xterm-window*
help.txt help.txt /*help.txt*

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.0aa. Last change: 2006 Mar 06
*todo.txt* For Vim version 7.0aa. Last change: 2006 Mar 07
VIM REFERENCE MANUAL by Bram Moolenaar
@ -30,47 +30,30 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs*
-------------------- Known bugs and current work -----------------------
When expanding on the command line, recognize shell commands, such as ":!cmd".
Move from ExpandFromContext() to separate function.
Check for file being executable. EW_EXEC
Escape special characters ";&<>(){}". Also in file names. (Adri Verhoef)
Autoload:
- Add a Vim script in $VIMRUNTIME/tools that takes a file with a list of
script names and a help file and produces a script that can be sourced to
install the scripts in the user's directories.
Use findfile(), so that only file names need to be given:
script plugin/myscript.vim
script autoload/mylib.vim
script autoload/yourlib.vim
helpfile doc/myscript.txt
For the "helpfile" item ":helptags" is run.
Win32: Describe how to do debugging and describe it. (George Reilly)
Are there more commands where v:swapcommand can be set to something useful?
Mac unicode patch (Da Woon Jung):
- Mac: Unicode input and display (Eckehard Berns, 2004 June 27)
Other patch from Da Woon Jung, 2005 Jan 16.
8 Add patch from Muraoka Taro (Mar 16) to support input method on Mac?
New patch 2004 Jun 16
- Add default key mappings for the command key (Alan Schmitt)
use http://macvim.org/OSX/files/gvimrc
- selecting proportional font breaks display
- UTF-8 text causes display problems. Font replacement causes this.
- Command-key mappings do not work. (Alan Schmitt)
- Add default key mappings for the command key (Alan Schmitt)
use http://macvim.org/OSX/files/gvimrc
- With 'nopaste' pasting is wrong, with 'paste' Command-V doesn't work.
(Alan Schmitt)
Bug in Netbeans interface. (Xavier de Gaye, 2006 Mar 7)
CONSIDERED FOR VERSION 7.0:
Omni completion:
ccomplete:
- 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.
in the tags files, that is very slow. Is there another solution?
Check what happens when taglist() is called.
Could build the list of items for each structure in memory. Is that
faster? Not using too much memory?
- For C add tag "kind" field to each match?
@ -1625,6 +1608,15 @@ Syntax highlighting:
Built-in script language:
9 Autoload: Add a Vim script in $VIMRUNTIME/tools that takes a file with a
list of script names and a help file and produces a script that can be
sourced to install the scripts in the user's directories.
Use findfile(), so that only file names need to be given:
script plugin/myscript.vim
script autoload/mylib.vim
script autoload/yourlib.vim
helpfile doc/myscript.txt
For the "helpfile" item ":helptags" is run.
7 Execute a function with standard option values. No need to save and
restore option values. Especially useful for new options. Problem: how
to avoid a performance penalty (esp. for string options)?

View File

@ -1,4 +1,4 @@
*version7.txt* For Vim version 7.0aa. Last change: 2006 Mar 06
*version7.txt* For Vim version 7.0aa. Last change: 2006 Mar 07
VIM REFERENCE MANUAL by Bram Moolenaar
@ -647,6 +647,8 @@ New autocommand events: ~
|SpellFileMissing| when a spell file can't be found
|SourcePre| before sourcing a Vim script
|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
@ -725,6 +727,9 @@ Vietnamese message translations and menu. (Phan Vinh Thinh)
Others: ~
The Netbeans interface was updated for Sun Studio 10. The protocol number
goes from 2.2 to 2.3. (Gordon Prieur)
Mac: Add the selection type to the clipboard, so that Block, line and
character selections can be used between two Vims. (Eckehard Berns)
Also fixes the problem that setting 'clipboard' to "unnamed" breaks using
@ -792,6 +797,9 @@ IMPROVEMENTS *improvements-7*
Move the help for printing to a separate help file. It's quite a lot now.
When doing completion for ":!cmd", ":r !cmd" or ":w !cmd" executable files are
found in $PATH instead of looking for ordinary files in the current directlry.
When ":silent" is used and a backwards range is given for an Ex command the
range is swapped automatically instead of asking if that is OK.
@ -1862,4 +1870,7 @@ MS-DOS, Win32: When 'encoding' defaults to "latin1" then the value for
'iskeyword' was still for CPxxx. And when 'nocompatible' was set 'isprint'
would also be the wrong value.
When a command was defined not to take arguments and no '|' no warning message
would be given for using a '|'. Also with ":loadkeymap".
vim:tw=78:ts=8:ft=help:norl: