forked from VimPlug/emmet-vim
s/ExpandWord/expandWord/g
s/CompleteTag/completeTag/g Ready for next/prev item
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" emmet.vim
|
" emmet.vim
|
||||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||||
" Last Change: 15-Oct-2013.
|
" Last Change: 22-Oct-2013.
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
@@ -649,6 +649,12 @@ function! emmet#expandAbbr(mode, abbr) range
|
|||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! emmet#moveNextPrevItem(flag)
|
||||||
|
let type = emmet#getFileType()
|
||||||
|
let rtype = emmet#lang#exists(type) ? type : 'html'
|
||||||
|
return emmet#lang#{rtype}#moveNextPrevItem(a:flag)
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! emmet#moveNextPrev(flag)
|
function! emmet#moveNextPrev(flag)
|
||||||
let type = emmet#getFileType()
|
let type = emmet#getFileType()
|
||||||
let rtype = emmet#lang#exists(type) ? type : 'html'
|
let rtype = emmet#lang#exists(type) ? type : 'html'
|
||||||
@@ -773,7 +779,7 @@ function! emmet#codePretty() range
|
|||||||
call emmet#util#setContent(block, content)
|
call emmet#util#setContent(block, content)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! emmet#ExpandWord(abbr, type, orig)
|
function! emmet#expandWord(abbr, type, orig)
|
||||||
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*\)*$'
|
||||||
let str = a:abbr
|
let str = a:abbr
|
||||||
let type = a:type
|
let type = a:type
|
||||||
@@ -815,7 +821,7 @@ function! emmet#getSnippets(type)
|
|||||||
return emmet#getResource(type, 'snippets', {})
|
return emmet#getResource(type, 'snippets', {})
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! emmet#CompleteTag(findstart, base)
|
function! emmet#completeTag(findstart, base)
|
||||||
if a:findstart
|
if a:findstart
|
||||||
let line = getline('.')
|
let line = getline('.')
|
||||||
let start = col('.') - 1
|
let start = col('.') - 1
|
||||||
|
|||||||
@@ -160,6 +160,11 @@ function! emmet#lang#css#toString(settings, current, type, inline, filters, item
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! emmet#lang#css#imageSize()
|
function! emmet#lang#css#imageSize()
|
||||||
|
"let img_region = emmet#util#searchRegion('url(', ')')
|
||||||
|
"if !emmet#util#regionIsValid(img_region) || !emmet#util#cursorInRegion(img_region)
|
||||||
|
" return
|
||||||
|
"endif
|
||||||
|
"let content = emmet#util#getContent(img_region)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! emmet#lang#css#encodeImage()
|
function! emmet#lang#css#encodeImage()
|
||||||
@@ -241,6 +246,10 @@ function! emmet#lang#css#balanceTag(flag) range
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! emmet#lang#css#moveNextPrevItem(flag)
|
||||||
|
return emmet#lang#css#moveNextPrev(a:flag)
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! emmet#lang#css#moveNextPrev(flag)
|
function! emmet#lang#css#moveNextPrev(flag)
|
||||||
let pos = search('""\|()\|\(:\s*\zs$\)', a:flag ? 'Wbp' : 'Wp')
|
let pos = search('""\|()\|\(:\s*\zs$\)', a:flag ? 'Wbp' : 'Wp')
|
||||||
if pos == 2
|
if pos == 2
|
||||||
|
|||||||
@@ -235,6 +235,10 @@ function! emmet#lang#haml#balanceTag(flag) range
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! emmet#lang#haml#moveNextPrevItem(flag)
|
||||||
|
return emmet#lang#haml#moveNextPrev(a:flag)
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! emmet#lang#haml#moveNextPrev(flag)
|
function! emmet#lang#haml#moveNextPrev(flag)
|
||||||
let pos = search('""', a:flag ? 'Wb' : 'W')
|
let pos = search('""', a:flag ? 'Wb' : 'W')
|
||||||
if pos != 0
|
if pos != 0
|
||||||
|
|||||||
@@ -644,6 +644,15 @@ function! emmet#lang#html#balanceTag(flag) range
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! emmet#lang#html#moveNextPrevItem(flag)
|
||||||
|
silent! exe "normal \<esc>"
|
||||||
|
let mx = '\%([0-9a-zA-Z-:]\+\%(="[^"]*"\|=''[^'']*''\|[^ ''">\]]*\)\{0,1}\)'
|
||||||
|
let pos = searchpos('\s'.mx.'\zs', '')
|
||||||
|
if pos != [0,0]
|
||||||
|
call feedkeys('v?\s\zs'.mx."\<cr>", '')
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! emmet#lang#html#moveNextPrev(flag)
|
function! emmet#lang#html#moveNextPrev(flag)
|
||||||
let pos = search('\%(</\w\+\)\@<!\zs><\/\|\(""\)\|^\(\s*\)$', a:flag ? 'Wpb' : 'Wp')
|
let pos = search('\%(</\w\+\)\@<!\zs><\/\|\(""\)\|^\(\s*\)$', a:flag ? 'Wpb' : 'Wp')
|
||||||
if pos == 3
|
if pos == 3
|
||||||
|
|||||||
@@ -139,6 +139,10 @@ function! emmet#lang#sass#balanceTag(flag) range
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! emmet#lang#sass#moveNextPrevItem(flag)
|
||||||
|
return emmet#lang#sass#moveNextPrev(a:flag)
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! emmet#lang#sass#moveNextPrev(flag)
|
function! emmet#lang#sass#moveNextPrev(flag)
|
||||||
let pos = search('""\|\(^\s*|\s*\zs\)', a:flag ? 'Wpb' : 'Wp')
|
let pos = search('""\|\(^\s*|\s*\zs\)', a:flag ? 'Wpb' : 'Wp')
|
||||||
if pos == 2
|
if pos == 2
|
||||||
|
|||||||
@@ -108,6 +108,10 @@ function! emmet#lang#scss#balanceTag(flag) range
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! emmet#lang#scss#moveNextPrevItem(flag)
|
||||||
|
return emmet#lang#scss#moveNextPrev(a:flag)
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! emmet#lang#scss#moveNextPrev(flag)
|
function! emmet#lang#scss#moveNextPrev(flag)
|
||||||
call emmet#lang#css#moveNextPrev(a:flag)
|
call emmet#lang#css#moveNextPrev(a:flag)
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -213,6 +213,10 @@ function! emmet#lang#slim#balanceTag(flag) range
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! emmet#lang#slim#moveNextPrevItem(flag)
|
||||||
|
return emmet#lang#slim#moveNextPrev(a:flag)
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! emmet#lang#slim#moveNextPrev(flag)
|
function! emmet#lang#slim#moveNextPrev(flag)
|
||||||
let pos = search('""\|\(^\s*|\s*\zs\)', a:flag ? 'Wpb' : 'Wp')
|
let pos = search('""\|\(^\s*|\s*\zs\)', a:flag ? 'Wpb' : 'Wp')
|
||||||
if pos == 2
|
if pos == 2
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ function! s:test(...)
|
|||||||
call s:show_title(n+1, query)
|
call s:show_title(n+1, query)
|
||||||
else
|
else
|
||||||
call s:show_title(n+1, query)
|
call s:show_title(n+1, query)
|
||||||
unlet! res | let res = emmet#ExpandWord(query, testgroup.type, 0)
|
unlet! res | let res = emmet#expandWord(query, testgroup.type, 0)
|
||||||
endif
|
endif
|
||||||
for opt in keys(options)
|
for opt in keys(options)
|
||||||
if has_key(oldoptions, opt)
|
if has_key(oldoptions, opt)
|
||||||
|
|||||||
Reference in New Issue
Block a user