From 6b540d7db030e4110aa3a31dd06c6c41387444db Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Mon, 2 Mar 2020 00:34:02 +0100 Subject: Update --- indent/crystal.vim | 19 ++++++++++--------- indent/julia.vim | 5 ++--- indent/reason.vim | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'indent') 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\)\):\@!\>' . \ '\|\%(^\|[^.:@$]\)\@<=\' " 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\+\)\@', s, e) + let fb = JuliaMatch(a:lnum, line, '@\@', s, e) let fe = JuliaMatch(a:lnum, line, '@\@', s, e) if fb < 0 && fe < 0 @@ -134,7 +133,7 @@ function GetJuliaNestingStruct(lnum, ...) continue endif - let i = JuliaMatch(a:lnum, line, '@\@', s) + let i = JuliaMatch(a:lnum, line, '@\@', 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\)' -- cgit v1.2.3