bairui

sortstyles

Oct 3rd, 2011
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.35 KB | None | 0 0
  1. function! s:SortStyles(i1, i2)
  2.   if a:i1 =~ '^-'
  3.     let i1 = substitute(a:i1, '^\s*-\w\+-', '', '')
  4.   else
  5.     let i1 = a:i1
  6.   endif
  7.   if a:i2 =~ '^-'
  8.     let i2 = substitute(a:i2, '^\s*-\w\+-', '', '')
  9.   else
  10.     let i2 = a:i2
  11.   endif
  12.   if i1 == i2
  13.     return 0
  14.   elseif i1 < i2
  15.     return -1
  16.   else
  17.     return 1
  18.   endif
  19. endfunction
  20.  
  21.  
Advertisement
Add Comment
Please, Sign In to add comment