mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-09 03:54:47 +08:00
check region.
This commit is contained in:
@@ -98,27 +98,33 @@ function! zencoding#lang#css#balanceTag(flag) range
|
|||||||
if !zencoding#util#regionIsValid(block)
|
if !zencoding#util#regionIsValid(block)
|
||||||
if a:flag > 0
|
if a:flag > 0
|
||||||
let block = zencoding#util#searchRegion('^', ';')
|
let block = zencoding#util#searchRegion('^', ';')
|
||||||
|
if zencoding#util#regionIsValid(block)
|
||||||
call zencoding#util#selectRegion(block)
|
call zencoding#util#selectRegion(block)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
if a:flag > 0
|
if a:flag > 0
|
||||||
let content = zencoding#util#getContent(block)
|
let content = zencoding#util#getContent(block)
|
||||||
if content !~ '^{.*}$'
|
if content !~ '^{.*}$'
|
||||||
let block = zencoding#util#searchRegion('{', '}')
|
let block = zencoding#util#searchRegion('{', '}')
|
||||||
|
if zencoding#util#regionIsValid(block)
|
||||||
call zencoding#util#selectRegion(block)
|
call zencoding#util#selectRegion(block)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
let pos = searchpos('.*;', 'nW')
|
let pos = searchpos('.*;', 'nW')
|
||||||
if pos[0] != 0
|
if pos[0] != 0
|
||||||
call setpos('.', [0, pos[0], pos[1], 0])
|
call setpos('.', [0, pos[0], pos[1], 0])
|
||||||
let block = zencoding#util#searchRegion('^', ';')
|
let block = zencoding#util#searchRegion('^', ';')
|
||||||
|
if zencoding#util#regionIsValid(block)
|
||||||
call zencoding#util#selectRegion(block)
|
call zencoding#util#selectRegion(block)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
if a:flag == -2 || a:flag == 2
|
if a:flag == -2 || a:flag == 2
|
||||||
silent! exe "normal! gv"
|
silent! exe "normal! gv"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user