From 3345382cc2afd3b3a027d9abb5c101507ebb57d7 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Mon, 17 Apr 2017 00:00:04 +0200 Subject: [PATCH 1/2] highlight: default Cursor to guibg=fg, guifg=bg Closes #6508 --- src/nvim/syntax.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 1ed65ec52a..d5ff3707e8 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -5898,6 +5898,8 @@ static void syntime_report(void) static char *highlight_init_both[] = { "Conceal ctermbg=DarkGrey ctermfg=LightGrey guibg=DarkGrey guifg=LightGrey", + "Cursor guibg=fg guifg=bg", + "lCursor guibg=fg guifg=bg", "DiffText cterm=bold ctermbg=Red gui=bold guibg=Red", "ErrorMsg ctermbg=DarkRed ctermfg=White guibg=Red guifg=White", "IncSearch cterm=reverse gui=reverse", From 45aa465fba73a9422a5c37779666eb59e0616142 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 17 Apr 2017 03:53:29 +0200 Subject: [PATCH 2/2] test: Cursor after `:hi clear|syntax reset` Also enable tests on Windows. --- test/functional/ui/highlight_spec.lua | 45 +++++++++++++++------------ 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index 5f8fafef07..2bda907c33 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -2,23 +2,23 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local os = require('os') local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert +local command = helpers.command +local eval = helpers.eval local feed_command, request, eq = helpers.feed_command, helpers.request, helpers.eq -if helpers.pending_win32(pending) then return end - -describe('color scheme compatibility', function() +describe('colorscheme compatibility', function() before_each(function() clear() end) it('t_Co is set to 256 by default', function() - eq('256', request('vim_eval', '&t_Co')) + eq('256', eval('&t_Co')) request('nvim_set_option', 't_Co', '88') - eq('88', request('vim_eval', '&t_Co')) + eq('88', eval('&t_Co')) end) end) -describe('manual syntax highlight', function() +describe('highlight: `:syntax manual`', function() -- When using manual syntax highlighting, it should be preserved even when -- switching buffers... bug did only occur without :set hidden -- Ref: vim patch 7.4.1236 @@ -63,32 +63,32 @@ describe('manual syntax highlight', function() end) it("works with buffer switch and 'nohidden'", function() - feed_command('e tmp1.vim') - feed_command('e Xtest-functional-ui-highlight.tmp.vim') - feed_command('filetype on') - feed_command('syntax manual') - feed_command('set ft=vim') - feed_command('set syntax=ON') + command('e tmp1.vim') + command('e Xtest-functional-ui-highlight.tmp.vim') + command('filetype on') + command('syntax manual') + command('set filetype=vim fileformat=unix') + command('set syntax=ON') feed('iecho 10') - feed_command('set nohidden') - feed_command('w') - feed_command('bn') - feed_command('bp') + command('set nohidden') + command('w') + command('silent bn') + eq("tmp1.vim", eval("fnamemodify(bufname('%'), ':t')")) + feed_command('silent bp') + eq("Xtest-functional-ui-highlight.tmp.vim", eval("fnamemodify(bufname('%'), ':t')")) screen:expect([[ {1:^echo} 1 | {0:~ }| {0:~ }| {0:~ }| -