From c226973bd5507781fa20bcacfd2620ac7f0934b4 Mon Sep 17 00:00:00 2001 From: jdhao Date: Sun, 27 Sep 2020 19:20:42 +0800 Subject: [PATCH] refactor: simplify if else --- autoload/utils.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/autoload/utils.vim b/autoload/utils.vim index 6afda90..0f9ee19 100644 --- a/autoload/utils.vim +++ b/autoload/utils.vim @@ -56,13 +56,13 @@ function! utils#VimFolds(lnum) abort if l:cur_line =~# '^"{' return '>' . (matchend(l:cur_line, '"{*') - 1) - else - if l:cur_line ==# '' && (matchend(l:next_line, '"{*') - 1) == 1 - return 0 - else - return '=' - endif endif + + if l:cur_line ==# '' && (matchend(l:next_line, '"{*') - 1) == 1 + return 0 + endif + + return '=' endfunction " Custom fold text, adapted from https://vi.stackexchange.com/a/3818/15292