Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions indent/cucumber.vim
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ function! GetCucumberIndent()
elseif syn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || line =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):'
" line after background, scenario or outline heading
return 2 * &sw
elseif cline =~# '^\s*\%(And\|But\)' && line =~# '^\s*\%(When\|Then\)'
return indent(prevnonblank(v:lnum-1)) + 1
elseif cline =~# '^\s*\%(And\|But\)' && line =~# '^\s*\%(Given\)'
return indent(prevnonblank(v:lnum-1)) + 2
elseif cline =~# '^\s*\%(When\|Then\)' && line =~# '^\s*\%(Given\)'
return indent(prevnonblank(v:lnum-1)) + 1
elseif cline =~# '^\s*\%(When\|Then\)' && line =~# '^\s*\%(And\|But\)'
return indent(prevnonblank(v:lnum-1)) - 1
elseif cline =~# '^\s*\%(When\|Then\)' && line =~# '^\s*\%(When\|Then\)'
return indent(prevnonblank(v:lnum-1))
elseif cline =~# '^\s*[@#]' && (nsyn == 'cucumberFeature' || nline =~# '^\s*Feature:' || indent(prevnonblank(v:lnum-1)) <= 0)
" tag or comment before a feature heading
return 0
Expand Down