From d219055bc845253eff2b27d30a23b11b97b7ee9d Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Sun, 19 Nov 2017 21:26:59 +0100 Subject: Update --- indent/blade.vim | 2 +- indent/clojure.vim | 19 +++++--- indent/glsl.vim | 1 + indent/javascript.vim | 120 +++++++++++++++++++++++++++++--------------------- indent/lua.vim | 46 +++++++++---------- indent/perl.vim | 14 +++--- indent/ps1.vim | 2 +- indent/qml.vim | 6 +-- 8 files changed, 116 insertions(+), 94 deletions(-) (limited to 'indent') diff --git a/indent/blade.vim b/indent/blade.vim index 95cc00a4..e93d48c9 100644 --- a/indent/blade.vim +++ b/indent/blade.vim @@ -19,7 +19,7 @@ let b:did_indent = 1 " Doesn't include 'foreach' and 'forelse' because these already get matched by 'for'. let s:directives_start = 'if\|else\|unless\|for\|while\|empty\|push\|section\|can\|hasSection\|verbatim\|php\|' . - \ 'component\|slot\|prepend' + \ 'component\|slot\|prepend\|auth\|guest' let s:directives_end = 'else\|end\|empty\|show\|stop\|append\|overwrite' if exists('g:blade_custom_directives_pairs') diff --git a/indent/clojure.vim b/indent/clojure.vim index f538195a..6d21c3d1 100644 --- a/indent/clojure.vim +++ b/indent/clojure.vim @@ -192,11 +192,7 @@ if exists("*searchpairpos") " Check if form is a reader conditional, that is, it is prefixed by #? " or @#? function! s:is_reader_conditional_special_case(position) - if getline(a:position[0])[a:position[1] - 3 : a:position[1] - 2] == "#?" - return 1 - endif - - return 0 + return getline(a:position[0])[a:position[1] - 3 : a:position[1] - 2] == "#?" endfunction " Returns 1 for opening brackets, -1 for _anything else_. @@ -294,6 +290,19 @@ if exists("*searchpairpos") return paren endif + " If the keyword begins with #, check if it is an anonymous + " function or set, in which case we indent by the shiftwidth + " (minus one if g:clojure_align_subforms = 1), or if it is + " ignored, in which case we use the ( position for indent. + if w[0] == "#" + " TODO: Handle #=() and other rare reader invocations? + if w[1] == '(' || w[1] == '{' + return [paren[0], paren[1] + (g:clojure_align_subforms ? 0 : &shiftwidth - 1)] + elseif w[1] == '_' + return paren + endif + endif + " Test words without namespace qualifiers and leading reader macro " metacharacters. " diff --git a/indent/glsl.vim b/indent/glsl.vim index b959da00..64f3a6fa 100644 --- a/indent/glsl.vim +++ b/indent/glsl.vim @@ -8,6 +8,7 @@ if exists("b:did_indent") endif setlocal autoindent cindent +setlocal formatoptions+=roq " vim:set sts=2 sw=2 : diff --git a/indent/javascript.vim b/indent/javascript.vim index 728fa117..f6fda1dc 100644 --- a/indent/javascript.vim +++ b/indent/javascript.vim @@ -12,10 +12,6 @@ if exists('b:did_indent') endif let b:did_indent = 1 -" indent correctly if inside