From 1abf65b087ff3c22d932647c426373f172877a17 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Mon, 8 Feb 2021 21:51:59 +0200 Subject: [PATCH] [nvim] properly display wavy underlines under spelling mistakes now that I have enabled all termcap features of kitty --- nvim/colors/dotfiles.vim | 13 +++++++++---- nvim/plugin/interface.vim | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/nvim/colors/dotfiles.vim b/nvim/colors/dotfiles.vim index 6ca399f..03ab4e9 100644 --- a/nvim/colors/dotfiles.vim +++ b/nvim/colors/dotfiles.vim @@ -137,10 +137,15 @@ hi! link ctrlsfMatch Search hi! link ctrlsfLnumMatch ctrlsfMatch - call s:hi('SpellBad', 'bg', '', 'undercurl', 0x8) - call s:hi('SpellLocal', 'bg', '', 'undercurl', 0xC) - call s:hi('SpellCap', 'bg', '', 'undercurl', 0xD) - call s:hi('SpellRare', 'bg', '', 'undercurl', 0xE) + let s:is_kitty = $TERM ==# 'xterm-kitty' + let s:spell_fg = s:is_kitty ? '' : 'bg' + let s:spell_bg = s:is_kitty ? 'NONE' : '' + let s:spell_attr = s:is_kitty ? 'undercurl' : '' + call s:hi('SpellBad', s:spell_fg, s:spell_bg, s:spell_attr, 0x8) + call s:hi('SpellLocal', s:spell_fg, s:spell_bg, s:spell_attr, 0xC) + call s:hi('SpellCap', s:spell_fg, s:spell_bg, s:spell_attr, 0xD) + call s:hi('SpellRare', s:spell_fg, s:spell_bg, s:spell_attr, 0xE) + unlet s:is_kitty s:spell_fg s:spell_bg s:spell_attr call s:hi('Sneak', 'bg', 0xB, 'bold', '') hi! link SneakScope Visual diff --git a/nvim/plugin/interface.vim b/nvim/plugin/interface.vim index 3f2e4e2..03693c7 100644 --- a/nvim/plugin/interface.vim +++ b/nvim/plugin/interface.vim @@ -44,9 +44,9 @@ endif let l:cmd = a:cmd if &modified let l:answer = confirm("Save changes?", "&Yes\n&No\n&Cancel") - if l:answer is# 1 " Yes + if l:answer ==# 1 " Yes write - elseif l:answer is# 2 " No + elseif l:answer ==# 2 " No let l:cmd .= '!' else " Cancel/Other return