tamton-aquib / staline.nvim

A modern lightweight statusline and bufferline plugin for neovim in lua.
MIT License
380 stars 17 forks source link

add new option "inactive_bgcolor" for more control over inactive buffers statusline #14

Closed obxhdx closed 3 years ago

obxhdx commented 3 years ago

I really like how simple and easy to use this plugin is, compared to the alternatives. The only thing I missed was being able to define the background color of the statusline in an inactive buffer, hence this pull request.

Below are some screenshots illustrating the changes.

With these settings:

require('stabline').setup {
  defaults = {
    bg = '#d5c4a1',
    inactive_color = 'gray',
    -- omitting irrelevant parts...
  },
  mode_colors = {
    ['n'] = '#444444',
  },
  -- omitting irrelevant parts...
}

I used to get:

before

Now I get:

after

And I'm now exposing a new property called inactive_bgcolor that allows more control:

require('stabline').setup {
  defaults = {
    bg = '#d5c4a1',
    inactive_color = '#444444',
    inactive_bgcolor = 'gray',
    -- omitting irrelevant parts...
  },
  mode_colors = {
    ['n'] = '#444444',
  },
  -- omitting irrelevant parts...
}

With the settings above I get:

after2

By default, inactive_bgcolor is set to "none", which is the same default value of bg, therefore I expect call_highlights to function in the same way as before. This should help maintain backwards compatibility.

tamton-aquib commented 3 years ago

Heyyo @obxhdx , This is definitely a fine addition to the plugin, and a perfect explanation. Thanks for this :)

Tried your version, and i haven't encountered any bugs, so merging to the main branch itself. If you're planning on additional changes, would suggest doing that on beta branch 😅.

Thanks again.