diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-04-05 20:41:53 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-04-05 20:41:53 +0000 |
commit | 910f66f90c928da8b607ccfdc12fc33d9cb8d4a9 (patch) | |
tree | 152a03d1d7ea3e8d433addba4f463d8a7a68a5fd /runtime/autoload/xmlcomplete.vim | |
parent | e2f98b95c8071f772695602cd4f714dc588eb8e7 (diff) | |
download | vim-git-910f66f90c928da8b607ccfdc12fc33d9cb8d4a9.tar.gz |
updated for version 7.0c10v7.0c10
Diffstat (limited to 'runtime/autoload/xmlcomplete.vim')
-rw-r--r-- | runtime/autoload/xmlcomplete.vim | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/runtime/autoload/xmlcomplete.vim b/runtime/autoload/xmlcomplete.vim index 2551cae30..582dc1066 100644 --- a/runtime/autoload/xmlcomplete.vim +++ b/runtime/autoload/xmlcomplete.vim @@ -1,13 +1,13 @@ " Vim completion script " Language: XML " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) -" Last Change: 2006 Mar 19 +" Last Change: 2006 Mar 31 " This function will create Dictionary with users namespace strings and values " canonical (system) names of data files. Names should be lowercase, " descriptive to avoid any future conflicts. For example 'xhtml10s' should be " name for data of XHTML 1.0 Strict and 'xhtml10t' for XHTML 1.0 Transitional -" User interface will be provided by XMLns command defined ... +" User interface will be provided by XMLns command defined in ftplugin/xml.vim " Currently supported canonicals are: " xhtml10s - XHTML 1.0 Strict " xsl - XSL @@ -224,8 +224,13 @@ function! xmlcomplete#CompleteTags(findstart, base) let attrs = ['encoding', 'version="1.0"', 'version'] elseif tag =~ '^!' " Don't make completion at all + " return [] else + if !has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}, tag) + " Abandon when data file isn't complete + return [] + endif let attrs = keys(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1]) endif @@ -324,6 +329,10 @@ function! xmlcomplete#CompleteTags(findstart, base) let tags = keys(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}) call filter(tags, 'v:val !~ "^vimxml"') else + if !has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}, tag) + " Abandon when data file isn't complete + return [] + endif let tags = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[opentag][0] endif |