mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-08 11:34:46 +08:00
fixed join tag for xsl. close #48
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" zencoding.vim
|
" zencoding.vim
|
||||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||||
" Last Change: 25-Nov-2011.
|
" Last Change: 30-Nov-2011.
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
@@ -944,10 +944,10 @@ endfunction
|
|||||||
function! zencoding#splitJoinTag()
|
function! zencoding#splitJoinTag()
|
||||||
let curpos = getpos('.')
|
let curpos = getpos('.')
|
||||||
while 1
|
while 1
|
||||||
let mx = '<\(/\{0,1}[a-zA-Z][a-zA-Z0-9]*\)[^>]*>'
|
let mx = '<\(/\{0,1}[a-zA-Z][a-zA-Z0-9:]*\)[^>]*>'
|
||||||
let pos1 = searchpos(mx, 'bcnW')
|
let pos1 = searchpos(mx, 'bcnW')
|
||||||
let content = matchstr(getline(pos1[0])[pos1[1]-1:], mx)
|
let content = matchstr(getline(pos1[0])[pos1[1]-1:], mx)
|
||||||
let tag_name = substitute(content, '^<\(/\{0,1}[a-zA-Z0-9]*\).*$', '\1', '')
|
let tag_name = substitute(content, '^<\(/\{0,1}[a-zA-Z][a-zA-Z0-9:]*\).*$', '\1', '')
|
||||||
let block = [pos1, [pos1[0], pos1[1] + len(content) - 1]]
|
let block = [pos1, [pos1[0], pos1[1] + len(content) - 1]]
|
||||||
if content[-2:] == '/>' && s:cursor_in_region(block)
|
if content[-2:] == '/>' && s:cursor_in_region(block)
|
||||||
let content = content[:-3] . "></" . tag_name . '>'
|
let content = content[:-3] . "></" . tag_name . '>'
|
||||||
|
|||||||
Reference in New Issue
Block a user