echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
5.24k stars 190 forks source link

highlighting disappears with bluz71/vim-nightfly-colors #652

Closed jt4201 closed 10 months ago

jt4201 commented 10 months ago

Contributing guidelines

Module(s)

mini.pick, mini.extra

Description

In mini.pick, MiniPickMatchCurrent is linked to CursorLine and MiniPickNormal is linked to NormalFloat

In bluz/vim-nightfly-colors, both CursorLine and NormalFloat set bg=dark_blue. This makes the current line look the same as the background.

There is already a limited Mini... highlights section in nightfly. I read the section about updating colorschemes, but since the Mini highlights already exist, some one may already "own" this.

My workaround is to set MiniPickMatchCurrent to { standout = true }

vim.api.nvim_set_hl(0, "MiniPickMatchCurrent", { standout = true })

Neovim version

0.9.5

Steps to reproduce

  1. create test nvim config
    # I use fish as a shell, but this should work with bash/zsh
    mkdir ~/.config/nvim-test
    cd ~/.config/nvim-test
    git init
    mkdir -p pack/{plugins,themes}/{opt,start}
    git submodule add https://github.com/bluz71/vim-nightfly-colors pack/themes/start/nightfly
    git submodule add https://github.com/echasnovski/mini.nvim pack/plugins/start/mini.nvim
  2. create .config/nvim-test/init.lua
    vim.g.mapleader = ' '
    vim.opt.termguicolors = true
    vim.opt.background = 'dark'
    vim.cmd.colorscheme('nightfly')
    require('mini.pick').setup({ })
    require('mini.extra').setup({ })
    vim.keymap.set('n', '<leader>ff', '<cmd>Pick explorer<cr>')
  3. run test version with
    NVIM_APPNAME=nvim-test nvim

Expected behavior

you can see the current line with a highlight

Actual behavior

current line is not highlighted

jt4201 commented 10 months ago

Spent some time with the docs and found a switch that solves this.

vim.g.nightflyNormalFloat = true
echasnovski commented 10 months ago

The highlight group definitions which come directly from 'mini.pick' are there only as default values. This means that they are (hopefully) reasonable choices which should work with most color schemes. But not all.

Dealing with highlight groups which come from color scheme is suggested to be done by user. It is perfectly appropriate to have :colorscheme ... call followed by some user adjustments. Like in this case followed by vim.api.nvim_set_hl(0, "MiniPickMatchCurrent", { standout = true }). To work with any color scheme, these adjustments can be put in the autocommand for ColorScheme event.

echasnovski commented 4 months ago

After bluz71/vim-nightfly-colors#61 there should be now better support for 'mini.pick'.