From cd23a38f2b3cd8834d1624e125b29c2f5fe78844 Mon Sep 17 00:00:00 2001 From: mattn Date: Tue, 11 Mar 2014 21:07:07 +0900 Subject: [PATCH] should be contains last \n --- autoload/emmet.vim | 15 ++++++++------- autoload/emmet/lang/html.vim | 2 +- unittest.vim | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/autoload/emmet.vim b/autoload/emmet.vim index 99ed368..d22a58e 100644 --- a/autoload/emmet.vim +++ b/autoload/emmet.vim @@ -222,7 +222,7 @@ function! emmet#toString(...) let str .= inner else let snippet = current.snippet - if len(current.snippet) == 0 + if len(snippet) == 0 let snippets = emmet#getResource(type, 'snippets', {}) if !empty(snippets) && has_key(snippets, 'emmet_snippet') let snippet = snippets['emmet_snippet'] @@ -653,6 +653,7 @@ function! emmet#expandAbbr(mode, abbr) range silent! s/\$cursor\$// silent! call setpos('.', pos) let &selection = oldselection + redraw endif if g:emmet_debug > 1 call getchar() @@ -1396,12 +1397,12 @@ let s:emmet_settings = { \ 'html': { \ 'snippets': { \ '!': "html:5", -\ '!!!': "", -\ '!!!4t': "", -\ '!!!4s': "", -\ '!!!xt': "", -\ '!!!xs': "", -\ '!!!xxs': "", +\ '!!!': "\n", +\ '!!!4t': "\n", +\ '!!!4s': "\n", +\ '!!!xt': "\n", +\ '!!!xs': "\n", +\ '!!!xxs': "\n", \ 'c': "", \ 'cc:ie6': "", \ 'cc:ie': "", diff --git a/autoload/emmet/lang/html.vim b/autoload/emmet/lang/html.vim index 54d5a51..8bb40f6 100644 --- a/autoload/emmet/lang/html.vim +++ b/autoload/emmet/lang/html.vim @@ -120,7 +120,7 @@ function! emmet#lang#html#parseIntoTree(abbr, type) if use_pipe_for_cursor let snippet = substitute(snippet, '|', '${cursor}', 'g') endif - let lines = split(snippet, "\n") + let lines = split(snippet, "\n", 1) call map(lines, 'substitute(v:val, "\\( \\|\\t\\)", escape(indent, "\\\\"), "g")') let current.snippet = join(lines, "\n") let current.name = '' diff --git a/unittest.vim b/unittest.vim index b78ef0f..597d1f5 100644 --- a/unittest.vim +++ b/unittest.vim @@ -860,7 +860,7 @@ finish 'tests': [ { 'query': "xsd:w3c", - 'result': "\n\n\t\n", + 'result': "\n\n\t\n\n", }, ], },