vim version: 7.3.138

When editin an HTML file in vim, omni completion produces error on id
attribute, if non-existent css file is included. Error message:

Error detected while processing function htmlcomplete#CompleteTags:
line 304:
E121: Undefined variable: classlines

Apparently classlines is not initialized in the loop. Simple patch attached.


Steps to reproduce:

Edit an HTML file in vim. e.g.
vim --noplugin index.html
Include a stylesheet that's not a file, e.g.
<link rel="stylesheet" href="/css/404.css" type="text/css"
media="screen" charset="utf-8" />
In insert mode, type <div id=" followed by CTRL-X_CTRL-O
The error message is produced.

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
--- a/runtime/autoload/htmlcomplete.vim 2011-03-18 17:41:53.000000000 +0000
+++ b/runtime/autoload/htmlcomplete.vim 2011-04-25 02:04:02.941626099 +0000
@@ -285,6 +285,7 @@
                                let cssfiles = styletable + secimportfiles
                                let classes = []
                                for file in cssfiles
+                                       let classlines = []
                                        if filereadable(file)
                                                let stylesheet = readfile(file)
                                                let stylefile = 
join(stylesheet, ' ')

Raspunde prin e-mail lui