nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.
MIT License
5.95k stars 462 forks source link

Feat: different background color for modified windows #553

Closed renkam closed 2 years ago

renkam commented 2 years ago

Requested feature

I would like to set separate custom color to all the modified windows' statuses. So in short. When I open an existing file, the colors are 'normal'. If I modify the file it should have different background color. Then if I open another file in a split I would like to see the modified file background status color to be more intense to indicate, that I am leaving window with unsaved changes.

Motivation

I think it is important to not forget that something is modified and not written yet if you working with multiple splits, or do a variable rename and other open buffers are changed. The modified status indicator [+] is not enough to notify user about that, especially when often inactive windows have darkened foreground color.

shadmansaleh commented 2 years ago

duplicate #335 #315

This has been proposed before and decided this won't be included out of the box with lualine .

You can use a custom component like this https://github.com/nvim-lualine/lualine.nvim/issues/335#issuecomment-916759033

renkam commented 2 years ago

Looks like the component (from #335) is working. Maybe it is worth mentioning about it in readme file? I was looking issues for this topic and couldn't find anything useful, and probably there are more people like me (third duplicate).

Also I can'd understand why you don't want to include this to lualine. It is such useful feature that for some reason no one want to implement. Take a look on other editors/ide they all have some sort of indicator for unsaved files.

shadmansaleh commented 2 years ago

Maybe it is worth mentioning about it in readme file?

I've added it to component-snippets

I can'd understand why you don't want to include this to lualine

I think changing colors based on modified status fot sections a bad idea (airline basically allows themes to specify two themes one for filename not modified and one for modified) . Maybe I'd reconsider adding this just to filename component as opt in feature. Personally I like providing users a way to customize instead of providing everything out of the box (It's impossible to please everyone :D) . Extened components in config was added in response to first issue about color changing filename .

Take a look on other editors/ide they all have some sort of indicator for unsaved files.

Even then I think this belongs to tabline (bufferline) rather then in windows statusline . For example nvim-bufferline shows a nice colored dot based on modified status . I think that's more nit and helps you more with your issue then statusline changing colors

I think it is important to not forget that something is modified and not written yet if you working with multiple splits, or do a variable rename and other open buffers are changed.