adding new stuff
This commit is contained in:
parent
f84d7183aa
commit
9ef8a96f9a
1580 changed files with 0 additions and 0 deletions
22
plugins/bundle/xptemplate/autoload/xpt/priority.vim
Normal file
22
plugins/bundle/xptemplate/autoload/xpt/priority.vim
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
if exists( "g:__AL_XPT_PRIORITY_f78d9s873942__" ) && g:__AL_XPT_PRIORITY_f78d9s873942__ >= XPT#ver
|
||||
finish
|
||||
endif
|
||||
let g:__AL_XPT_PRIORITY_f78d9s873942__ = XPT#ver
|
||||
let s:oldcpo = &cpo
|
||||
set cpo-=< cpo+=B
|
||||
let s:priorities = { 'lowest': 9999999, 'all':64, 'spec' : 48, 'like' : 32, 'lang' : 16, 'sub':8, 'personal' : 0, 'highest':-1, }
|
||||
let s:priorities.default = s:priorities.lang
|
||||
fun! xpt#priority#Get(pstr)
|
||||
return s:priorities[a:pstr]
|
||||
endfunction
|
||||
fun! xpt#priority#Parse(pstr)
|
||||
let pstr = a:pstr
|
||||
if pstr =~ '\V\[+-]\$'
|
||||
let pstr .= '1'
|
||||
endif
|
||||
let reg = '\V\(\w\+\|\[+-]\)\zs'
|
||||
let prioParts = split(pstr,reg)
|
||||
let prioParts[0] = get(s:priorities,prioParts[0],prioParts[0] - 0)
|
||||
return eval( join( prioParts, '' ) )
|
||||
endfunction
|
||||
let &cpo = s:oldcpo
|
||||
Loading…
Add table
Add a link
Reference in a new issue