diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2020-03-02 00:34:02 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-03-02 00:34:02 +0100 |
commit | 6b540d7db030e4110aa3a31dd06c6c41387444db (patch) | |
tree | 1cd1da5b35cf1c34b38d7506ff93aabf861747bf /indent/crystal.vim | |
parent | 35ea4d2b9072594b6c0ccf87bde7978ed9f94755 (diff) | |
download | vim-polyglot-6b540d7db030e4110aa3a31dd06c6c41387444db.tar.gz vim-polyglot-6b540d7db030e4110aa3a31dd06c6c41387444db.zip |
Update
Diffstat (limited to 'indent/crystal.vim')
-rw-r--r-- | indent/crystal.vim | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/indent/crystal.vim b/indent/crystal.vim index 380b1dbe..94767afe 100644 --- a/indent/crystal.vim +++ b/indent/crystal.vim @@ -17,7 +17,7 @@ setlocal nosmartindent setlocal indentexpr=GetCrystalIndent(v:lnum) setlocal indentkeys=0{,0},0),0],!^F,o,O,e,:,. setlocal indentkeys+==end,=else,=elsif,=when,=ensure,=rescue,==begin,==end -setlocal indentkeys+==private,=protected,=public +setlocal indentkeys+==private,=protected " Only define the function once. if exists('*GetCrystalIndent') @@ -49,12 +49,12 @@ let s:skip_expr = " Regex used for words that, at the start of a line, add a level of indent. let s:crystal_indent_keywords = - \ '^\s*\zs\<\%(module\|\%(private\s\+\)\=\%(abstract\s\+\)\=\%(class\|struct\)\|enum\|if' . - \ '\|for\|macro\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\|lib' . - \ '\|\%(protected\|private\)\=\s*def\):\@!\>' . + \ '^\s*\zs\<\%(\%(\%(private\|protected\)\s\+\)\=\%(abstract\s\+\)\=\%(class\|struct\)' . + \ '\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\|union' . + \ '\|\%(private\|protected\)\=\s*\%(def\|class\|struct\|module\|macro\|lib\|enum\)\):\@!\>' . \ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' . \ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>' . - \ '\|{%\s*\<\%(if\|for\|while\|until\|lib\|case\|unless\|begin\|else\|elsif\|when\)' + \ '\|{%\s*\<\%(if\|for\|while\|until\|case\|unless\|begin\|else\|elsif\|when\)' " Regex used for words that, at the start of a line, remove a level of indent. let s:crystal_deindent_keywords = @@ -64,10 +64,11 @@ let s:crystal_deindent_keywords = " Regex that defines the start-match for the 'end' keyword. " TODO: the do here should be restricted somewhat (only at end of line)? let s:end_start_regex = - \ '{%\s*\<\%(if\|for\|while\|until\|unless\|begin\|lib\)\>\|' . + \ '{%\s*\<\%(if\|for\|while\|until\|unless\|begin\)\>\|' . \ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' . - \ '\<\%(module\|\%(private\s\+\)\=\%(abstract\s\+\)\=\%(class\|struct\)\|enum\|macro\|if\|for\|while\|until\|case\|unless\|begin\|lib' . - \ '\|\%(protected\|private\)\=\s*def\):\@!\>' . + \ '\<\%(\%(\%(private\|protected\)\s\+\)\=\%(abstract\s\+\)\=\%(class\|struct\)' . + \ '\|if\|for\|while\|until\|case\|unless\|begin\|union' . + \ '\|\%(private\|protected\)\=\s*\%(def\|lib\|enum\|macro\|module\)\):\@!\>' . \ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>' " Regex that defines the middle-match for the 'end' keyword. @@ -122,7 +123,7 @@ let s:block_continuation_regex = '^\s*[^])}\t ].*'.s:block_regex let s:leading_operator_regex = '^\s*[.]' " Regex that describes all indent access modifiers -let s:access_modifier_regex = '\C^\s*\%(public\|protected\|private\)\s*\%(#.*\)\=$' +let s:access_modifier_regex = '\C^\s*\%(protected\|private\)\s*\%(#.*\)\=$' " 2. Auxiliary Functions {{{1 " ====================== |