Refactor warnings

This commit is contained in:
Marco Hinz 2018-05-05 14:14:21 +02:00
parent 3969c6bcf3
commit 2cdbe64a7d
No known key found for this signature in database
GPG key ID: 1C980A1B657B4A4F

View file

@ -49,7 +49,7 @@ function! startify#insane_in_the_membrane() abort
endif endif
if !&hidden && &modified if !&hidden && &modified
call s:warn('startify: Save your changes first.') call s:warn('Save your changes first.')
return return
endif endif
@ -107,7 +107,7 @@ function! startify#insane_in_the_membrane() abort
endif endif
if empty(v:oldfiles) if empty(v:oldfiles)
call s:warn("startify: Can't read viminfo file. Read :help startify-faq-02") call s:warn("Can't read viminfo file. Read :help startify-faq-02")
endif endif
let b:startify.section_header_lines = [] let b:startify.section_header_lines = []
@ -780,7 +780,7 @@ function! s:is_in_skiplist(arg) abort
return 1 return 1
endif endif
catch catch
call s:warn('startify: Pattern '. string(regexp) .' threw an exception. Read :help g:startify_skiplist') call s:warn('Pattern '. string(regexp) .' threw an exception. Read :help g:startify_skiplist')
endtry endtry
endfor endfor
endfunction endfunction
@ -976,7 +976,7 @@ function! s:create_last_session_link(spath)
\ shellescape(s:session_dir .'/__LAST__')) \ shellescape(s:session_dir .'/__LAST__'))
call system(cmd) call system(cmd)
if v:shell_error if v:shell_error
echomsg "startify: Can't create 'last used session' symlink." call s:warn("Can't create 'last used session' symlink.")
endif endif
endif endif
endfunction endfunction
@ -1033,6 +1033,6 @@ endfunction
" Function: s:warn {{{1 " Function: s:warn {{{1
function! s:warn(msg) abort function! s:warn(msg) abort
echohl WarningMsg echohl WarningMsg
echomsg a:msg echomsg 'startify: '. a:msg
echohl NONE echohl NONE
endfunction endfunction