From 1aee272cc37670b4f96c5d75975ae8af3bd8809e Mon Sep 17 00:00:00 2001 From: itchyny Date: Mon, 12 Mar 2018 18:51:26 +0900 Subject: [PATCH] update calendar/color.vim, syntax/calendar.vim: support termguicolors (close #135) --- autoload/calendar/color.vim | 4 ++-- syntax/calendar.vim | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/autoload/calendar/color.vim b/autoload/calendar/color.vim index 7e127ed..b6425ff 100644 --- a/autoload/calendar/color.vim +++ b/autoload/calendar/color.vim @@ -2,7 +2,7 @@ " Filename: autoload/calendar/color.vim " Author: itchyny " License: MIT License -" Last Change: 2017/05/19 08:53:05. +" Last Change: 2018/03/12 18:49:09. " ============================================================================= let s:save_cpo = &cpo @@ -10,7 +10,7 @@ set cpo&vim " Color utility -let s:is_gui = has('gui_running') +let s:is_gui = has('gui_running') || (has('termguicolors') && &termguicolors) let s:is_cterm = !s:is_gui let s:is_win32cui = (has('win32') || has('win64')) && !s:is_gui let s:term = s:is_gui ? 'gui' : 'cterm' diff --git a/syntax/calendar.vim b/syntax/calendar.vim index 20b8903..030aa6c 100644 --- a/syntax/calendar.vim +++ b/syntax/calendar.vim @@ -2,7 +2,7 @@ " Filename: syntax/calendar.vim " Author: itchyny " License: MIT License -" Last Change: 2017/04/26 22:14:34. +" Last Change: 2018/03/12 18:49:05. " ============================================================================= if version < 700 @@ -14,14 +14,15 @@ endif let s:save_cpo = &cpo set cpo&vim +let s:is_gui = has('gui_running') || (has('termguicolors') && &termguicolors) let s:fg_color = calendar#color#normal_fg_color() let s:bg_color = calendar#color#normal_bg_color() let s:comment_fg_color = calendar#color#comment_fg_color() let s:select_color = calendar#color#gen_color(s:fg_color, s:bg_color, 1, 4) -let s:is_win32cui = (has('win32') || has('win64')) && !has('gui_running') +let s:is_win32cui = (has('win32') || has('win64')) && !s:is_gui let s:is_dark = calendar#color#is_dark() -if !has('gui_running') +if !s:is_gui if s:is_win32cui if s:is_dark let s:select_color = 8