aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2020-09-27 19:20:42 +0800
committerjdhao <jdhao@hotmail.com>2020-09-27 19:20:42 +0800
commitc226973bd5507781fa20bcacfd2620ac7f0934b4 (patch)
tree6d75d83ee7f199497d33b89f650cf84dfc07614a
parent32d69040d6f02cc1c17f8991eb240c024105d5d9 (diff)
refactor: simplify if else
-rw-r--r--autoload/utils.vim12
1 files 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