diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-02-18 22:14:51 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-02-18 22:14:51 +0000 |
commit | 7e8fd63682801d6cdd7f31972540c21f148b289e (patch) | |
tree | cbc44d7f10ef0a87454582fbff40fe930bacc6b6 /runtime/autoload | |
parent | 997fb4ba696625e27e17c00d5033b20411aa45a3 (diff) |
updated for version 7.0201v7.0201
Diffstat (limited to 'runtime/autoload')
-rw-r--r-- | runtime/autoload/htmlcomplete.vim | 22 | ||||
-rw-r--r-- | runtime/autoload/xmlcomplete.vim | 9 |
2 files changed, 18 insertions, 13 deletions
diff --git a/runtime/autoload/htmlcomplete.vim b/runtime/autoload/htmlcomplete.vim index 0b4bc5fd88..c28e3d3fc0 100644 --- a/runtime/autoload/htmlcomplete.vim +++ b/runtime/autoload/htmlcomplete.vim @@ -1,7 +1,7 @@ " Vim completion script " Language: XHTML 1.0 Strict " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) -" Last Change: 2006 Feb 6 +" Last Change: 2006 Feb 18 function! htmlcomplete#CompleteTags(findstart, base) if a:findstart @@ -540,24 +540,26 @@ function! htmlcomplete#CompleteTags(findstart, base) let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack") return [opentag.">"] endif + " Load data {{{ + if !exists("g:xmldata_xhtml10s") + runtime! autoload/xml/xhtml10s.vim + endif + " }}} + " Tag completion {{{ " Deal with tag completion. let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack") if opentag == '' " Hack for sometimes failing GetLastOpenTag. " As far as I tested fail isn't GLOT fault but problem " of invalid document - not properly closed tags and other mish-mash. - " If returns empty string assume <body>. Safe bet. - let opentag = 'body' - endif - " }}} - " Load data {{{ - if !exists("g:xmldata_xhtml10s") - runtime! autoload/xml/xhtml10s.vim + " Also when document is empty. Return list of *all* tags. + let tags = keys(g:xmldata_xhtml10s) + call filter(tags, 'v:val !~ "^vimxml"') + else + let tags = g:xmldata_xhtml10s[opentag][0] endif " }}} - " Tag completion {{{ - let tags = g:xmldata_xhtml10s[opentag][0] for m in sort(tags) if m =~ '^'.context diff --git a/runtime/autoload/xmlcomplete.vim b/runtime/autoload/xmlcomplete.vim index 22e81a4d93..6b7b804e36 100644 --- a/runtime/autoload/xmlcomplete.vim +++ b/runtime/autoload/xmlcomplete.vim @@ -1,7 +1,7 @@ " Vim completion script " Language: XML " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) -" Last Change: 2006 Feb 6 +" Last Change: 2006 Feb 18 " This function will create Dictionary with users namespace strings and values " canonical (system) names of data files. Names should be lowercase, @@ -319,10 +319,13 @@ function! xmlcomplete#CompleteTags(findstart, base) let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack") let opentag = substitute(opentag, '^\k*:', '', '') if opentag == '' - return [] + "return [] + let tags = keys(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}) + call filter(tags, 'v:val !~ "^vimxml"') + else + let tags = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[opentag][0] endif - let tags = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[opentag][0] let context = substitute(context, '^\k*:', '', '') for m in tags |