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 | |
parent | 35ea4d2b9072594b6c0ccf87bde7978ed9f94755 (diff) | |
download | vim-polyglot-6b540d7db030e4110aa3a31dd06c6c41387444db.tar.gz vim-polyglot-6b540d7db030e4110aa3a31dd06c6c41387444db.zip |
Update
Diffstat (limited to 'indent')
-rw-r--r-- | indent/crystal.vim | 19 | ||||
-rw-r--r-- | indent/julia.vim | 5 | ||||
-rw-r--r-- | indent/reason.vim | 4 |
3 files changed, 14 insertions, 14 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 " ====================== diff --git a/indent/julia.vim b/indent/julia.vim index c21548e3..13de44a0 100644 --- a/indent/julia.vim +++ b/indent/julia.vim @@ -50,9 +50,8 @@ function GetJuliaNestingStruct(lnum, ...) let e = a:0 > 1 ? a:2 : -1 let blocks_stack = [] let num_closed_blocks = 0 - let tt = get(b:, 'julia_syntax_version', 10) == 6 ? '\|\%(\%(abstract\|primitive\)\s\+\)\@<!type' : '' while 1 - let fb = JuliaMatch(a:lnum, line, '@\@<!\<\%(if\|else\%(if\)\?\|while\|for\|try\|catch\|finally\|\%(staged\)\?function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@<!struct\|\%(abstract\|primitive\)\s\+type\|immutable\|let\|\%(bare\)\?module\|quote\|do'.tt.'\)\>', s, e) + let fb = JuliaMatch(a:lnum, line, '@\@<!\<\%(if\|else\%(if\)\?\|while\|for\|try\|catch\|finally\|\%(staged\)\?function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@<!struct\|\%(abstract\|primitive\)\s\+type\|immutable\|let\|\%(bare\)\?module\|quote\|do\)\>', s, e) let fe = JuliaMatch(a:lnum, line, '@\@<!\<end\>', s, e) if fb < 0 && fe < 0 @@ -134,7 +133,7 @@ function GetJuliaNestingStruct(lnum, ...) continue endif - let i = JuliaMatch(a:lnum, line, '@\@<!\<\%(while\|for\|\%(staged\)\?function\|macro\|begin\|\%(mutable\s\+\)\?struct\|\%(abstract\|primitive\)\s\+type\|immutable\|let\|quote\|do'.tt.'\)\>', s) + let i = JuliaMatch(a:lnum, line, '@\@<!\<\%(while\|for\|\%(staged\)\?function\|macro\|begin\|\%(mutable\s\+\)\?struct\|\%(abstract\|primitive\)\s\+type\|immutable\|let\|quote\|do\)\>', s) if i >= 0 && i == fb if match(line, '\C\<\%(mutable\|abstract\|primitive\)', i) != -1 let s = i+11 diff --git a/indent/reason.vim b/indent/reason.vim index 43c6eb7c..7ee5c6db 100644 --- a/indent/reason.vim +++ b/indent/reason.vim @@ -78,7 +78,7 @@ function! s:is_string_comment(lnum, col) if has('syntax_items') for id in synstack(a:lnum, a:col) let synname = synIDattr(id, "name") - if synname == "rustString" || synname =~ "^rustComment" + if synname == "reasonString" || synname =~ "^reasonComment" return 1 endif endfor @@ -97,7 +97,7 @@ function GetReasonIndent(lnum) if has('syntax_items') let synname = synIDattr(synID(a:lnum, 1, 1), "name") - if synname == "rustString" + if synname == "reasonString" " If the start of the line is in a string, don't change the indent return -1 elseif synname =~ '\(Comment\|Todo\)' |