liuchengxu/vim-clap

ClapPreview is linked to FloatBorder which causes issue when re-applying colorscheme

sscherfke opened this issue · 1 comments

Environment (please complete the following information):

  • OS: any
  • (Neo)Vim version: 0.7+
  • vim-clap version: latest git
  • Have you reproduced with a minimal vimrc: yes
  • Have you updated to the latest plugin version: yes
  • Have you upgraded to/compiled the latest Rust binary: yes

Describe the bug

When you start vim and open Clap for the first time, the brew window contents and the preview window border have the same background color.

When you select a different colorscheme or reload the current color scheme and open Clap again, the preview window border has a different background color than the preveiw window contents.

The preview window border looks the same as the VertSplit (see screenshot)

Clap debug

To Reproduce
Steps to reproduce the behavior:

  1. Create the minimal vimrc min.vim:
set nocompatible
set runtimepath^=/path/to/vim-clap
syntax on
filetype plugin indent on
  1. Start (neo)vim with command: vim -u min.vim

  2. Type :Clap commits -> ClapPreview border has the same bg color as the preview window contents

  3. Ctrl+C

  4. Type :colorscheme delek (or any other)

  5. Type :Clap commits -> ClapPreview border has wrong color compared to preview window contents

Expected behavior
Preview window border keeps correct color

Screenshots
grafik

Additional context

The reason for this is that ClapPreview is linked to FloatBorder which is in turn linked to VertSplit:

autoload/clap/themes.vim
196:  hi default link FloatBorder ClapPreview

A workaround is explicitly setting a highlight for FloatBorder that has the same bg as ClapPreview.

Thank you very much. Works as expected now. ❤️