'empty' over 'strlen' for empty string check (duh)

This commit is contained in:
Strahinja Val Markovic 2013-03-09 19:31:00 -08:00
parent 82bd32aa16
commit c394cb557e

View File

@ -113,13 +113,13 @@ function! s:SetUpKeyMappings()
\ ' pumvisible() ? "\<C-p>" : "\' . key .'"' \ ' pumvisible() ? "\<C-p>" : "\' . key .'"'
endfor endfor
if strlen(g:ycm_key_invoke_completion) if !empty( g:ycm_key_invoke_completion )
" <c-x><c-o> trigger omni completion, <c-p> deselects the first completion " <c-x><c-o> trigger omni completion, <c-p> deselects the first completion
" candidate that vim selects by default " candidate that vim selects by default
exe 'inoremap <unique> ' . g:ycm_key_invoke_completion . ' <C-X><C-O><C-P>' exe 'inoremap <unique> ' . g:ycm_key_invoke_completion . ' <C-X><C-O><C-P>'
endif endif
if strlen(g:ycm_key_detailed_diagnostics) if !empty( g:ycm_key_detailed_diagnostics )
exe 'nnoremap <unique> ' . g:ycm_key_detailed_diagnostics . exe 'nnoremap <unique> ' . g:ycm_key_detailed_diagnostics .
\ ' :YcmShowDetailedDiagnostic<cr>' \ ' :YcmShowDetailedDiagnostic<cr>'
endif endif