summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorryanss2015-02-08 19:30:12 -0500
committerryanss2015-02-08 19:30:12 -0500
commitfb1416bb7a3ce41c971be0f5c4bd8929ec3897e6 (patch)
tree7bc7857151f12cab97a91d2c79d486d7dc9b0a6a
parent592caca496dda90ab5366cbec8d9d8704ee43c6e (diff)
downloadvim-hn-fb1416bb7a3ce41c971be0f5c4bd8929ec3897e6.tar.gz
Fix #15 Error setting ctermfg=bg when ctermbg=NONE
-rw-r--r--syntax/hackernews.vim15
1 files 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/