Fixes indentation bug. Closes #189

This commit is contained in:
mattn
2014-02-12 20:25:03 +09:00
parent 554e0c02f5
commit 6cd20746ad
2 changed files with 10 additions and 3 deletions

View File

@@ -517,10 +517,17 @@ function! emmet#expandAbbr(mode, abbr) range
let str = ''
if visualmode() ==# 'V'
let line = getline(a:firstline)
let lspaces = matchstr(line, '^\s*', '', '')
let part = substitute(line, '^\s*', '', '')
for n in range(a:firstline, a:lastline)
if len(leader) > 0
let line = getline(a:firstline)
let spaces = matchstr(line, '^\s*', '', '')
if len(spaces) >= len(lspaces)
let str .= indent . getline(n)[len(lspaces):] . "\n"
else
let str .= getline(n) . "\n"
endif
else
let lpart = substitute(getline(n), '^\s*', '', '')
let str .= lpart . "\n"

View File

@@ -514,8 +514,8 @@ finish
'result': "<span class=\"item1\">item 1</span>\n<span class=\"item2\">item 2</span>\n",
},
{
'query': " <div class=\"footer_nav\">\n <a href=\"#\">nav link</a>\n </div>$$$$\\<esc>ggVG\\<c-y>,div\\<cr>$$$$",
'result': " <div>\n <div class=\"footer_nav\">\n <a href=\"#\">nav link</a>\n </div>\n </div>",
'query': "\t<div class=\"footer_nav\">\n\t\t<a href=\"#\">nav link</a>\n\t</div>$$$$\\<esc>ggVG\\<c-y>,div\\<cr>$$$$",
'result': "\t<div>\n\t\t<div class=\"footer_nav\">\n\t\t\t<a href=\"#\">nav link</a>\n\t\t</div>\n\t</div>",
},
],
},