View difference between Paste ID: pYWcGseH and EG22aZ96
SHOW: | | - or go back to the newest paste.
1
" Barry Arthur
2
" Jan 2012
3
4
let b:fold_levels = {}
5-
    return '0'
5+
6
  let line = getline(a:lnum)
7
  if line =~ '^describe'
8
    return '>1'
9
  elseif line =~ '^\s\+\(describe\|it\)'
10-
  elseif line =~ '^\s\+}\s*)\s*;'
10+
11
    let b:fold_levels[lead] = lead
12
    return 'a1'
13
  elseif line =~ '^\s\+}\s*)\s*;.*'
14
    let lead = matchstr(line, '^\s\+')
15
    if has_key(b:fold_levels, lead)
16
      call remove(b:fold_levels, lead)
17
      return 's1'
18
    else
19
      return '='
20
    endif
21
  elseif line =~ '^});'
22
    return '<1'
23
  else
24
    return '='
25
  endif
26
endfunction
27
28
set fdm=expr
29
set fde=JST_Folds(v:lnum)