s/ExpandWord/expandWord/g

s/CompleteTag/completeTag/g
Ready for next/prev item
This commit is contained in:
mattn
2013-10-22 12:00:04 +09:00
parent ed7ab5fd49
commit ea1b779868
8 changed files with 44 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
"=============================================================================
" emmet.vim
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
" Last Change: 15-Oct-2013.
" Last Change: 22-Oct-2013.
let s:save_cpo = &cpo
set cpo&vim
@@ -649,6 +649,12 @@ function! emmet#expandAbbr(mode, abbr) range
return ''
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)
let type = emmet#getFileType()
let rtype = emmet#lang#exists(type) ? type : 'html'
@@ -773,7 +779,7 @@ function! emmet#codePretty() range
call emmet#util#setContent(block, content)
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 str = a:abbr
let type = a:type
@@ -815,7 +821,7 @@ function! emmet#getSnippets(type)
return emmet#getResource(type, 'snippets', {})
endfunction
function! emmet#CompleteTag(findstart, base)
function! emmet#completeTag(findstart, base)
if a:findstart
let line = getline('.')
let start = col('.') - 1

View File

@@ -160,6 +160,11 @@ function! emmet#lang#css#toString(settings, current, type, inline, filters, item
endfunction
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
function! emmet#lang#css#encodeImage()
@@ -241,6 +246,10 @@ function! emmet#lang#css#balanceTag(flag) range
endif
endfunction
function! emmet#lang#css#moveNextPrevItem(flag)
return emmet#lang#css#moveNextPrev(a:flag)
endfunction
function! emmet#lang#css#moveNextPrev(flag)
let pos = search('""\|()\|\(:\s*\zs$\)', a:flag ? 'Wbp' : 'Wp')
if pos == 2

View File

@@ -235,6 +235,10 @@ function! emmet#lang#haml#balanceTag(flag) range
endif
endfunction
function! emmet#lang#haml#moveNextPrevItem(flag)
return emmet#lang#haml#moveNextPrev(a:flag)
endfunction
function! emmet#lang#haml#moveNextPrev(flag)
let pos = search('""', a:flag ? 'Wb' : 'W')
if pos != 0

View File

@@ -644,6 +644,15 @@ function! emmet#lang#html#balanceTag(flag) range
endif
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)
let pos = search('\%(</\w\+\)\@<!\zs><\/\|\(""\)\|^\(\s*\)$', a:flag ? 'Wpb' : 'Wp')
if pos == 3

View File

@@ -139,6 +139,10 @@ function! emmet#lang#sass#balanceTag(flag) range
endif
endfunction
function! emmet#lang#sass#moveNextPrevItem(flag)
return emmet#lang#sass#moveNextPrev(a:flag)
endfunction
function! emmet#lang#sass#moveNextPrev(flag)
let pos = search('""\|\(^\s*|\s*\zs\)', a:flag ? 'Wpb' : 'Wp')
if pos == 2

View File

@@ -108,6 +108,10 @@ function! emmet#lang#scss#balanceTag(flag) range
endif
endfunction
function! emmet#lang#scss#moveNextPrevItem(flag)
return emmet#lang#scss#moveNextPrev(a:flag)
endfunction
function! emmet#lang#scss#moveNextPrev(flag)
call emmet#lang#css#moveNextPrev(a:flag)
endfunction

View File

@@ -213,6 +213,10 @@ function! emmet#lang#slim#balanceTag(flag) range
endif
endfunction
function! emmet#lang#slim#moveNextPrevItem(flag)
return emmet#lang#slim#moveNextPrev(a:flag)
endfunction
function! emmet#lang#slim#moveNextPrev(flag)
let pos = search('""\|\(^\s*|\s*\zs\)', a:flag ? 'Wpb' : 'Wp')
if pos == 2