mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-06 18:54:27 +08:00
Fixes indentation bug. Closes #189
This commit is contained in:
@@ -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 str .= getline(n) . "\n"
|
||||
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"
|
||||
|
||||
@@ -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>",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user