From 7551f9cd796a13905b14e482cd608e9c357820bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophane=20Hufschmitt?= Date: Tue, 18 Aug 2015 10:27:14 +0800 Subject: [PATCH] Added error message when running neovim with true colors --- autoload/limelight.vim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/autoload/limelight.vim b/autoload/limelight.vim index d447950..d59968c 100644 --- a/autoload/limelight.vim +++ b/autoload/limelight.vim @@ -32,6 +32,11 @@ set cpo&vim let s:default_coeff = str2float('0.5') let s:invalid_coefficient = 'Invalid coefficient. Expected: 0.0 ~ 1.0' +function! s:nvim_unsupported() + let var = 'g:limelight_conceal_guifg' + return 'Neovim with true colors is not yet supported. Please set '.var +endfunction + function! s:unsupported() let var = 'g:limelight_conceal_'.(has('gui_running') ? 'gui' : 'cterm').'fg' @@ -144,6 +149,8 @@ function! s:dim(coeff) let dim = g:limelight_conceal_guifg elseif empty(fg) || empty(bg) throw s:unsupported() + elseif has('nvim') + throw s:nvim_unsupported() else let coeff = s:coeff(a:coeff) let fg_rgb = s:hex2rgb(fg)