Skip to content

Commit

Permalink
Merge pull request #35 from p0deje/master
Browse files Browse the repository at this point in the history
Allow to overwrite Cucumber steps glob
  • Loading branch information
tpope committed Apr 13, 2015
2 parents 8f48260 + 0bd47ca commit 9b49b42
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ftplugin/cucumber.vim
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ setlocal omnifunc=CucumberComplete
let b:undo_ftplugin = "setl fo< com< cms< ofu<"

let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??')
if !exists("b:cucumber_steps_glob")
let b:cucumber_steps_glob = b:cucumber_root.'/**/*.rb'
endif

if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps")
cnoremap <SID>foldopen <Bar>if &foldopen =~# 'tag'<Bar>exe 'norm! zv'<Bar>endif
Expand Down Expand Up @@ -52,7 +55,7 @@ endfunction
function! s:allsteps()
let step_pattern = '\C^\s*\K\k*\>\s*(\=\s*\zs\S.\{-\}\ze\s*)\=\s*\%(do\|{\)\s*\%(|[^|]*|\s*\)\=\%($\|#\)'
let steps = []
for file in split(glob(b:cucumber_root.'/**/*.rb'),"\n")
for file in split(glob(b:cucumber_steps_glob),"\n")
let lines = readfile(file)
let num = 0
for line in lines
Expand Down

0 comments on commit 9b49b42

Please sign in to comment.