checkhealth: validate locale (#9548)

Test case:

    LANG= LC_ALL= LC_CTYPE= tmux
    nvim -u NORC +'checkhealth nvim'
This commit is contained in:
Justin M. Keyes 2019-01-26 00:41:42 +01:00 committed by GitHub
parent 6e6bc3b6c0
commit ec5a4d862d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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.",