Skip to content

Commit e0a1d84

Browse files
committed
Fix further "reservedword:" indenting
1 parent 4b612b2 commit e0a1d84

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

indent/ruby.vim

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,33 +52,33 @@ let s:skip_expr =
5252
" Regex used for words that, at the start of a line, add a level of indent.
5353
let s:ruby_indent_keywords = '^\s*\zs\<\%(module\|class\|def\|if\|for' .
5454
\ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure' .
55-
\ '\|rescue\)\>' .
55+
\ '\|rescue\):\@!\>' .
5656
\ '\|\%([*+/,=-]\|<<\|>>\|:\s\)\s*\zs' .
5757
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>'
5858

5959
" Regex used for words that, at the start of a line, remove a level of indent.
6060
let s:ruby_deindent_keywords =
61-
\ '^\s*\zs\<\%(ensure\|else\|rescue\|elsif\|when\|end\)\>'
61+
\ '^\s*\zs\<\%(ensure\|else\|rescue\|elsif\|when\|end\):\@!\>'
6262

6363
" Regex that defines the start-match for the 'end' keyword.
6464
"let s:end_start_regex = '\%(^\|[^.]\)\<\%(module\|class\|def\|if\|for\|while\|until\|case\|unless\|begin\|do\)\>'
6565
" TODO: the do here should be restricted somewhat (only at end of line)?
6666
let s:end_start_regex = '^\s*\zs\<\%(module\|class\|def\|if\|for' .
67-
\ '\|while\|until\|case\|unless\|begin\)\>' .
67+
\ '\|while\|until\|case\|unless\|begin\):\@!\>' .
6868
\ '\|\%([*+/,=-]\|<<\|>>\|:\s\)\s*\zs' .
69-
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\)\>' .
70-
\ '\|\<do\>'
69+
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>' .
70+
\ '\|\<do:\@!\>'
7171

7272
" Regex that defines the middle-match for the 'end' keyword.
73-
let s:end_middle_regex = '\<\%(ensure\|else\|\%(\%(^\|;\)\s*\)\@<=\<rescue\>\|when\|elsif\)\>'
73+
let s:end_middle_regex = '\<\%(ensure\|else\|\%(\%(^\|;\)\s*\)\@<=\<rescue:\@!\>\|when\|elsif\):\@!\>'
7474

7575
" Regex that defines the end-match for the 'end' keyword.
76-
let s:end_end_regex = '\%(^\|[^.:@$]\)\@<=\<end\>'
76+
let s:end_end_regex = '\%(^\|[^.:@$]\)\@<=\<end:\@!\>'
7777

7878
" Expression used for searchpair() call for finding match for 'end' keyword.
7979
let s:end_skip_expr = s:skip_expr .
8080
\ ' || (expand("<cword>") == "do"' .
81-
\ ' && getline(".") =~ "^\\s*\\<\\(while\\|until\\|for\\)\\>")'
81+
\ ' && getline(".") =~ "^\\s*\\<\\(while\\|until\\|for\\):\\@!\\>")'
8282

8383
" Regex that defines continuation lines, not including (, {, or [.
8484
let s:continuation_regex = '\%([\\*+/.,:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$'
@@ -90,7 +90,7 @@ let s:continuation_regex2 =
9090

9191
" Regex that defines blocks.
9292
let s:block_regex =
93-
\ '\%(\<do\>\|{\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=\s*\%(#.*\)\=$'
93+
\ '\%(\<do:\@!\>\|{\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=\s*\%(#.*\)\=$'
9494

9595
" 2. Auxiliary Functions {{{1
9696
" ======================

0 commit comments

Comments
 (0)