1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

refactor: simplify if else

This commit is contained in:
jdhao 2020-09-27 19:20:42 +08:00
parent 32d69040d6
commit c226973bd5

View File

@ -56,13 +56,13 @@ function! utils#VimFolds(lnum) abort
if l:cur_line =~# '^"{' if l:cur_line =~# '^"{'
return '>' . (matchend(l:cur_line, '"{*') - 1) return '>' . (matchend(l:cur_line, '"{*') - 1)
else endif
if l:cur_line ==# '' && (matchend(l:next_line, '"{*') - 1) == 1 if l:cur_line ==# '' && (matchend(l:next_line, '"{*') - 1) == 1
return 0 return 0
else endif
return '=' return '='
endif
endif
endfunction endfunction
" Custom fold text, adapted from https://vi.stackexchange.com/a/3818/15292 " Custom fold text, adapted from https://vi.stackexchange.com/a/3818/15292