diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-01-26 00:41:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-26 00:41:42 +0100 |
commit | ec5a4d862d71729569acf4afac4c371a09edc314 (patch) | |
tree | ca175bd660fcc5e5ef4055a37c0053f7ca3be0d0 | |
parent | 6e6bc3b6c0fbf073a77fa62e45c8db87177b02ad (diff) | |
download | rneovim-ec5a4d862d71729569acf4afac4c371a09edc314.tar.gz rneovim-ec5a4d862d71729569acf4afac4c371a09edc314.tar.bz2 rneovim-ec5a4d862d71729569acf4afac4c371a09edc314.zip |
checkhealth: validate locale (#9548)
Test case:
LANG= LC_ALL= LC_CTYPE= tmux
nvim -u NORC +'checkhealth nvim'
-rw-r--r-- | runtime/autoload/health.vim | 2 | ||||
-rw-r--r-- | runtime/autoload/health/nvim.vim | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim index 56ae2071e9..0f7983f175 100644 --- a/runtime/autoload/health.vim +++ b/runtime/autoload/health.vim @@ -30,7 +30,7 @@ function! health#check(plugin_names) abort \ : s:to_fn_names(a:plugin_names) tabnew - setlocal wrap breakindent + setlocal wrap breakindent linebreak setlocal filetype=markdown setlocal conceallevel=2 concealcursor=nc setlocal keywordprg=:help diff --git a/runtime/autoload/health/nvim.vim b/runtime/autoload/health/nvim.vim index 93660d05dc..efa3292801 100644 --- a/runtime/autoload/health/nvim.vim +++ b/runtime/autoload/health/nvim.vim @@ -25,6 +25,15 @@ function! s:check_config() abort \ 'https://github.com/neovim/neovim/wiki/Following-HEAD#20170402' ]) endif + if v:ctype ==# 'C' + let ok = v:false + call health#report_error('Locale does not support UTF-8. Unicode characters may not display correctly.' + \ .printf("\n$LANG=%s $LC_ALL=%s $LC_CTYPE=%s", $LANG, $LC_ALL, $LC_CTYPE), + \ [ 'If using tmux, try the -u option.', + \ 'Ensure that your terminal/shell/tmux/etc inherits the environment, or set $LANG explicitly.' , + \ 'Configure your system locale.' ]) + endif + if &paste let ok = v:false call health#report_error("'paste' is enabled. This option is only for pasting text.\nIt should not be set in your config.", |