mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 03:04:27 +08:00
Workaround
This commit is contained in:
@@ -452,6 +452,7 @@ function! emmet#expandAbbr(mode, abbr) range
|
|||||||
let line = ''
|
let line = ''
|
||||||
let part = ''
|
let part = ''
|
||||||
let rest = ''
|
let rest = ''
|
||||||
|
let ret = pumvisible() ? "" : "<right>"
|
||||||
|
|
||||||
let filters = emmet#getFilters(type)
|
let filters = emmet#getFilters(type)
|
||||||
if len(filters) == 0
|
if len(filters) == 0
|
||||||
@@ -461,7 +462,7 @@ function! emmet#expandAbbr(mode, abbr) range
|
|||||||
if a:mode == 2
|
if a:mode == 2
|
||||||
let leader = substitute(input('Tag: ', ''), '^\s*\(.*\)\s*$', '\1', 'g')
|
let leader = substitute(input('Tag: ', ''), '^\s*\(.*\)\s*$', '\1', 'g')
|
||||||
if len(leader) == 0
|
if len(leader) == 0
|
||||||
return ''
|
return ret
|
||||||
endif
|
endif
|
||||||
let mx = '|\(\%(html\|haml\|slim\|e\|c\|fc\|xsl\|t\|\/[^ ]\+\)\s*,\{0,1}\s*\)*$'
|
let mx = '|\(\%(html\|haml\|slim\|e\|c\|fc\|xsl\|t\|\/[^ ]\+\)\s*,\{0,1}\s*\)*$'
|
||||||
if leader =~ mx
|
if leader =~ mx
|
||||||
@@ -553,7 +554,7 @@ function! emmet#expandAbbr(mode, abbr) range
|
|||||||
endif
|
endif
|
||||||
normal! $
|
normal! $
|
||||||
call emmet#expandAbbr(0, "")
|
call emmet#expandAbbr(0, "")
|
||||||
return ''
|
return ret
|
||||||
else
|
else
|
||||||
let line = getline('.')
|
let line = getline('.')
|
||||||
if col('.') < len(line)
|
if col('.') < len(line)
|
||||||
@@ -650,7 +651,7 @@ function! emmet#expandAbbr(mode, abbr) range
|
|||||||
if g:emmet_debug > 1
|
if g:emmet_debug > 1
|
||||||
call getchar()
|
call getchar()
|
||||||
endif
|
endif
|
||||||
return ''
|
return ret
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! emmet#moveNextPrevItem(flag)
|
function! emmet#moveNextPrevItem(flag)
|
||||||
@@ -671,7 +672,7 @@ function! emmet#imageSize()
|
|||||||
let rtype = emmet#lang#exists(type) ? type : 'html'
|
let rtype = emmet#lang#exists(type) ? type : 'html'
|
||||||
call emmet#lang#{rtype}#imageSize()
|
call emmet#lang#{rtype}#imageSize()
|
||||||
silent! call setpos('.', orgpos)
|
silent! call setpos('.', orgpos)
|
||||||
return ''
|
return pumvisible() ? "" : "<right>"
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! emmet#encodeImage()
|
function! emmet#encodeImage()
|
||||||
@@ -684,7 +685,7 @@ function! emmet#toggleComment()
|
|||||||
let type = emmet#getFileType()
|
let type = emmet#getFileType()
|
||||||
let rtype = emmet#lang#exists(type) ? type : 'html'
|
let rtype = emmet#lang#exists(type) ? type : 'html'
|
||||||
call emmet#lang#{rtype}#toggleComment()
|
call emmet#lang#{rtype}#toggleComment()
|
||||||
return ''
|
return pumvisible() ? "" : "<right>"
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! emmet#balanceTag(flag) range
|
function! emmet#balanceTag(flag) range
|
||||||
@@ -710,7 +711,7 @@ function! emmet#removeTag()
|
|||||||
let type = emmet#getFileType()
|
let type = emmet#getFileType()
|
||||||
let rtype = emmet#lang#exists(type) ? type : 'html'
|
let rtype = emmet#lang#exists(type) ? type : 'html'
|
||||||
call emmet#lang#{rtype}#removeTag()
|
call emmet#lang#{rtype}#removeTag()
|
||||||
return ''
|
return pumvisible() ? "" : "<right>"
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! emmet#anchorizeURL(flag)
|
function! emmet#anchorizeURL(flag)
|
||||||
@@ -719,7 +720,7 @@ function! emmet#anchorizeURL(flag)
|
|||||||
let url = matchstr(getline(pos1[0])[pos1[1]-1:], mx)
|
let url = matchstr(getline(pos1[0])[pos1[1]-1:], mx)
|
||||||
let block = [pos1, [pos1[0], pos1[1] + len(url) - 1]]
|
let block = [pos1, [pos1[0], pos1[1] + len(url) - 1]]
|
||||||
if !emmet#util#cursorInRegion(block)
|
if !emmet#util#cursorInRegion(block)
|
||||||
return ''
|
return pumvisible() ? "" : "<right>"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let mx = '.*<title[^>]*>\s*\zs\([^<]\+\)\ze\s*<\/title[^>]*>.*'
|
let mx = '.*<title[^>]*>\s*\zs\([^<]\+\)\ze\s*<\/title[^>]*>.*'
|
||||||
@@ -759,7 +760,7 @@ function! emmet#anchorizeURL(flag)
|
|||||||
let indent = substitute(getline('.'), '^\(\s*\).*', '\1', '')
|
let indent = substitute(getline('.'), '^\(\s*\).*', '\1', '')
|
||||||
let expand = substitute(expand, "\n", "\n" . indent, 'g')
|
let expand = substitute(expand, "\n", "\n" . indent, 'g')
|
||||||
call emmet#util#setContent(block, expand)
|
call emmet#util#setContent(block, expand)
|
||||||
return ''
|
return pumvisible() ? "" : "<right>"
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! emmet#codePretty() range
|
function! emmet#codePretty() range
|
||||||
|
|||||||
Reference in New Issue
Block a user