From e404a658b1647fad396a954776eda0bdabf8353c Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 20 Dec 2016 20:57:20 +0100 Subject: Update --- autoload/htmlcomplete.vim | 1404 +++++++++++++++++++++++---------------------- 1 file changed, 703 insertions(+), 701 deletions(-) (limited to 'autoload/htmlcomplete.vim') diff --git a/autoload/htmlcomplete.vim b/autoload/htmlcomplete.vim index f58793a2..fc9a4b5a 100644 --- a/autoload/htmlcomplete.vim +++ b/autoload/htmlcomplete.vim @@ -1,12 +1,12 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1 " Vim completion script -" Language: HTML and XHTML -" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) -" Last Change: 2006 Oct 19 +" Language: HTML and XHTML +" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) +" Last Change: 2006 Oct 19 " Modified: othree " Changes: Add HTML5, WAI-ARIA support -" Last Change: 2010 Sep 25 +" Last Change: 2016 Oct 11 if !exists('g:aria_attributes_complete') let g:aria_attributes_complete = 1 @@ -16,42 +16,42 @@ endif " To use with other HTML versions add another "elseif" condition to match " proper DOCTYPE. function! htmlcomplete#DetectOmniFlavor() - if &filetype == 'xhtml' - let b:html_omni_flavor = 'xhtml10s' - else - let b:html_omni_flavor = 'html5' + if &filetype == 'xhtml' + let b:html_omni_flavor = 'xhtml10s' + else + let b:html_omni_flavor = 'html5' + endif + let i = 1 + let line = "" + while i < 10 && i < line("$") + let line = getline(i) + if line =~ '' - let b:html_omni_flavor = 'html40' - endif - if line =~ '\' - let b:html_omni_flavor .= 't' - elseif line =~ '\' - let b:html_omni_flavor .= 'f' - else - let b:html_omni_flavor .= 's' - endif - endif + let i += 1 + endwhile + if line =~ '' + let b:html_omni_flavor = 'html40' + endif + if line =~ '\' + let b:html_omni_flavor .= 't' + elseif line =~ '\' + let b:html_omni_flavor .= 'f' + else + let b:html_omni_flavor .= 's' + endif endif + endif endfunction function! htmlcomplete#CompleteTags(findstart, base) @@ -59,491 +59,493 @@ function! htmlcomplete#CompleteTags(findstart, base) " locate the start of the word let line = getline('.') let start = col('.') - 1 - let curline = line('.') - let compl_begin = col('.') - 2 + let curline = line('.') + let compl_begin = col('.') - 2 while start >= 0 && line[start - 1] =~ '\(\k\|[!:.-]\)' - let start -= 1 + 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