Skip to content

Commit

Permalink
Simplify highlighting: remove SneakCursor
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
justinmk committed Jan 6, 2017
1 parent 017d88e commit 311b905
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions autoload/sneak/hl.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion autoload/sneak/label.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 311b905

Please sign in to comment.