From e105e1242a87ed413190ca213c4944393e6089b3 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 14 Jul 2018 14:29:53 -0400 Subject: [PATCH] vim-patch:8.0.1600: crash when setting t_Co to zero when 'termguicolors' is set Problem: Crash when setting t_Co to zero when 'termguicolors' is set. Solution: Use IS_CTERM instead of checking the number of colors. (closes vim/vim#2710) https://github.com/vim/vim/commit/f708ac592f47100a36f2bc12ec98ea6357fdfa27 --- src/nvim/testdir/test_highlight.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/nvim/testdir/test_highlight.vim b/src/nvim/testdir/test_highlight.vim index 6ee994bb9a..ce6262c811 100644 --- a/src/nvim/testdir/test_highlight.vim +++ b/src/nvim/testdir/test_highlight.vim @@ -514,3 +514,17 @@ func Test_highlight_eol_on_diff() bwipe! diffoff endfunc + +func Test_termguicolors() + if !exists('+termguicolors') + return + endif + + " Basic test that setting 'termguicolors' works with one color. + set termguicolors + redraw + set t_Co=1 + redraw + set t_Co=0 + redraw +endfunc