From fb1416bb7a3ce41c971be0f5c4bd8929ec3897e6 Mon Sep 17 00:00:00 2001 From: ryanss Date: Sun, 8 Feb 2015 19:30:12 -0500 Subject: Fix #15 Error setting ctermfg=bg when ctermbg=NONE --- syntax/hackernews.vim | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/syntax/hackernews.vim b/syntax/hackernews.vim index bc249a2..a21d68b 100644 --- a/syntax/hackernews.vim +++ b/syntax/hackernews.vim @@ -18,11 +18,16 @@ syn match Ignore /\s\[[0-9]\{3,}\]$/ " Make sure `Ignore` highlight group is hidden " Some colorschemes do not hide the `Ignore` group (ex. Solarized) -if has('gui_running') - highlight Ignore guifg=bg -else - highlight Ignore ctermfg=bg -endif +" An exception will be raised here if ctermfg=NONE which is sometimes set +" when using a transparent terminal so we wrap these commands in try/catch +try + if has('gui_running') + highlight Ignore guifg=bg + else + highlight Ignore ctermfg=bg + endif +catch +endtry " Remove emphesis from all components of main page item except title syn match Comment /^\s*[0-9]\{1,2}\.\s/ -- cgit v1.2.3