removeTag for haml & slim.

This commit is contained in:
mattn
2012-06-04 17:12:31 +09:00
parent d3f4db7367
commit 4dfd07003e
4 changed files with 93 additions and 36 deletions

View File

@@ -189,3 +189,29 @@ endfunction
function! zencoding#lang#slim#splitJoinTag()
" TODO
endfunction
function! zencoding#lang#slim#removeTag()
let n = line('.')
let ml = 0
while n > 0
if getline(n) =~ '^\s*\ze[a-z]'
let ml = len(matchstr(getline(n), '^\s*[a-z]'))
break
endif
let n -= 1
endwhile
let sn = n
while n < line('$')
let l = len(matchstr(getline(n), '^\s*[a-z]'))
if l > 0 && l <= ml
let n -= 1
break
endif
let n += 1
endwhile
if sn == n
exe "delete"
else
exe sn "," (n-1) "delete"
endif
endfunction