diff --git a/autoload/zencoding.vim b/autoload/zencoding.vim index f864aa1..0ae3aad 100644 --- a/autoload/zencoding.vim +++ b/autoload/zencoding.vim @@ -62,7 +62,7 @@ function! s:zen_parseIntoTree(abbr, type) endif let abbr = substitute(abbr, '\([a-zA-Z][a-zA-Z0-9]*\)+\([()]\|$\)', '\="(".s:zen_getExpandos(type, submatch(1)).")".submatch(2)', 'i') - let mx = '\([+>]\|<\+\)\{-}\s*\((*\)\{-}\s*\([@#]\{-}[a-zA-Z\!][a-zA-Z0-9:\!\-]*\|{[^}]\+}\)\(\%(\%(#[a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[a-zA-Z0-9_\-\$]\+\)\)*\)\%(\({[^}]\+}\)\)\{0,1}\%(\s*\*\s*\([0-9]\+\)\s*\)\{0,1}\(\%(\s*)\%(\s*\*\s*[0-9]\+\s*\)\{0,1}\)*\)' + let mx = '\([+>]\|<\+\)\{-}\s*\((*\)\{-}\s*\([@#]\{-}[a-zA-Z\!][a-zA-Z0-9:\!\-]*\|{[^}]\+}\)\(\%(\%(#{[{}a-zA-Z0-9_\-\$]\+\|#[a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.{[{}a-zA-Z0-9_\-\$]\+\|\.[a-zA-Z0-9_\-\$]\+\)\)*\)\%(\({[^}]\+}\)\)\{0,1}\%(\s*\*\s*\([0-9]\+\)\s*\)\{0,1}\(\%(\s*)\%(\s*\*\s*[0-9]\+\s*\)\{0,1}\)*\)' let root = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0 } let parent = root let last = root @@ -1279,6 +1279,7 @@ function! zencoding#ExpandWord(abbr, type, orig) endfor if a:orig == 0 let expand = substitute(expand, '\${lang}', s:zen_settings.lang, 'g') + let expand = substitute(expand, '\${charset}', s:zen_settings.charset, 'g') let expand = substitute(expand, '\${cursor}', '', 'g') endif return expand diff --git a/unittest.vim b/unittest.vim index 3792039..8eda70e 100644 --- a/unittest.vim +++ b/unittest.vim @@ -406,6 +406,12 @@ finish 'type': "html", 'result': "\n", }, + { + 'name': "div>a#foo{bar}", + 'query': "div>a#foo{bar}", + 'type': "html", + 'result': "