From 311b905e4da3fdaeb12aae51229742f3a789a334 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 6 Jan 2017 16:06:39 +0100 Subject: [PATCH] Simplify highlighting: remove SneakCursor `SneakCursor` was added as a workaround for the case where the user's `Cursor` highlight was broken. But with 'termguicolors', there are more cases to consider (also: `has('gui_running')` is meaningless in Nvim). Instead of adding more handling, just use `Cursor`. If the user has a broken Cursor highlight, it's better that they fix it. --- autoload/sneak/hl.vim | 6 ------ autoload/sneak/label.vim | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/autoload/sneak/hl.vim b/autoload/sneak/hl.vim index d35415a..3bd1bcd 100644 --- a/autoload/sneak/hl.vim +++ b/autoload/sneak/hl.vim @@ -50,12 +50,6 @@ func! s:init() abort if 0 == hlID("SneakLabelMask") " fg same as bg exec 'highlight SneakLabelMask guifg='.guibg.' guibg='.guibg.' ctermfg='.ctermbg.' ctermbg='.ctermbg endif - - if has('gui_running') || -1 != match(sneak#hl#get('Cursor'), 'ctermbg') - highlight link SneakCursor Cursor - else - highlight link SneakCursor SneakScope - endif endf augroup sneak_colorscheme " re-init if :colorscheme is changed at runtime. #108 diff --git a/autoload/sneak/label.vim b/autoload/sneak/label.vim index f8bf0cb..f415edd 100644 --- a/autoload/sneak/label.vim +++ b/autoload/sneak/label.vim @@ -137,7 +137,7 @@ func! s:before() ownsyntax sneak_label " highlight the cursor location (else the cursor is not visible during getchar()) - let w:sneak_cursor_hl = matchadd("SneakCursor", '\%#', 11, -1) + let w:sneak_cursor_hl = matchadd("Cursor", '\%#', 11, -1) let s:cc_orig=&l:concealcursor | setlocal concealcursor=ncv let s:cl_orig=&l:conceallevel | setlocal conceallevel=2