aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-06-25 01:31:41 +0200
committerGitHub <noreply@github.com>2019-06-25 01:31:41 +0200
commit5ae57b7e571ff8faefcbee84af24bf58ec097fa3 (patch)
tree5921a5d4026a528b222c363bcc06f7bb1bbfcb56
parent8c7e41f596e60031099c36c915a3f610b893d60e (diff)
downloadrneovim-5ae57b7e571ff8faefcbee84af24bf58ec097fa3.tar.gz
rneovim-5ae57b7e571ff8faefcbee84af24bf58ec097fa3.tar.bz2
rneovim-5ae57b7e571ff8faefcbee84af24bf58ec097fa3.zip
health.vim: check shada file #10327
closes #1202
-rw-r--r--runtime/autoload/health/nvim.vim8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/autoload/health/nvim.vim b/runtime/autoload/health/nvim.vim
index 8fcea2e941..a2227e3b29 100644
--- a/runtime/autoload/health/nvim.vim
+++ b/runtime/autoload/health/nvim.vim
@@ -8,7 +8,7 @@ function! s:check_config() abort
if !filereadable(vimrc)
let ok = v:false
let has_vim = filereadable(expand('~/.vimrc'))
- call health#report_warn('Missing user config file: '.vimrc,
+ call health#report_warn((-1 == getfsize(vimrc) ? 'Missing' : 'Unreadable').' user config file: '.vimrc,
\[ has_vim ? ':help nvim-from-vim' : ':help init.vim' ])
endif
@@ -41,6 +41,12 @@ function! s:check_config() abort
\ 'Check `:verbose set paste?` to see if a plugin or script set the option.', ])
endif
+ let shadafile = (empty(&shadafile) || &shadafile ==# 'NONE') ? stdpath('data').'/shada/main.shada' : &shadafile
+ if !empty(shadafile) && (!filereadable(shadafile) || !filewritable(shadafile))
+ let ok = v:false
+ call health#report_error('shada file is not '.(filereadable(shadafile) ? 'writeable' : 'readable').":\n".shadafile)
+ endif
+
if ok
call health#report_ok('no issues found')
endif