To: vim_dev@googlegroups.com Subject: Patch 8.0.1600 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1600 Problem: Crash when setting t_Co to zero when 'termguicolors' is set. Solution: Use IS_CTERM instead of checking the number of colors. (closes #2710) Files: src/screen.c, src/testdir/test_highlight.vim *** ../vim-8.0.1599/src/screen.c 2018-03-06 11:43:00.327652783 +0100 --- src/screen.c 2018-03-12 21:47:11.345120613 +0100 *************** *** 8127,8133 **** term_bg_color(aep->ae_u.cterm.bg_color - 1); } ! if (t_colors <= 1) { if (aep->ae_u.term.start != NULL) out_str(aep->ae_u.term.start); --- 8127,8133 ---- term_bg_color(aep->ae_u.cterm.bg_color - 1); } ! if (!IS_CTERM) { if (aep->ae_u.term.start != NULL) out_str(aep->ae_u.term.start); *** ../vim-8.0.1599/src/testdir/test_highlight.vim 2017-10-01 14:34:58.577346624 +0200 --- src/testdir/test_highlight.vim 2018-03-12 21:46:47.633277140 +0100 *************** *** 514,516 **** --- 514,530 ---- 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 *** ../vim-8.0.1599/src/version.c 2018-03-11 20:51:48.226288941 +0100 --- src/version.c 2018-03-12 21:47:29.405001476 +0100 *************** *** 768,769 **** --- 768,771 ---- { /* Add new patch number below this line */ + /**/ + 1600, /**/ -- The average life of an organization chart is six months. You can safely ignore any order from your boss that would take six months to complete. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///