diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2019-06-08 12:44:15 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2019-06-08 12:44:15 +0200 |
commit | 671078ef6c851b688b63165761cec82f9f6e03f7 (patch) | |
tree | efde30baaf2ca21a09a35e1ccf1d2ff744482d2b /indent/kotlin.vim | |
parent | aebef2c2e76b88384b1121c237c965e8cf8b3bcb (diff) | |
download | vim-polyglot-671078ef6c851b688b63165761cec82f9f6e03f7.tar.gz vim-polyglot-671078ef6c851b688b63165761cec82f9f6e03f7.zip |
Update
Diffstat (limited to 'indent/kotlin.vim')
-rw-r--r-- | indent/kotlin.vim | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/indent/kotlin.vim b/indent/kotlin.vim index a9a1ae20..56211b36 100644 --- a/indent/kotlin.vim +++ b/indent/kotlin.vim @@ -5,9 +5,9 @@ endif " Vim indent file " Language: Kotlin " Maintainer: Alexander Udalov -" Latest Revision: 15 July 2017 +" Latest Revision: 26 May 2019 -if exists("b:did_indent") +if exists('b:did_indent') finish endif let b:did_indent = 1 @@ -45,24 +45,14 @@ function! GetKotlinIndent() let prev_open_paren = prev =~ '^.*(\s*$' let cur_close_paren = cur =~ '^\s*).*$' - - if prev_open_paren && !cur_close_paren - return prev_indent + 2 * &shiftwidth - endif - - if cur_close_paren && !prev_open_paren - return prev_indent - 2 * &shiftwidth - endif - - let prev_open_brace = prev =~ '^.*\({\|->\)\s*$' let cur_close_brace = cur =~ '^\s*}.*$' - if prev_open_brace && !cur_close_brace + if prev_open_paren && !cur_close_paren || prev_open_brace && !cur_close_brace return prev_indent + &shiftwidth endif - if cur_close_brace && !prev_open_brace + if cur_close_paren && !prev_open_paren || cur_close_brace && !prev_open_brace return prev_indent - &shiftwidth endif |