From 671078ef6c851b688b63165761cec82f9f6e03f7 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Sat, 8 Jun 2019 12:44:15 +0200 Subject: Update --- indent/kotlin.vim | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'indent/kotlin.vim') 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 -- cgit v1.2.3