ap / vim-buftabline

Forget Vim tabs – now you can have buffer tabs
http://www.vim.org/scripts/script.php?script_id=5057
MIT License
782 stars 75 forks source link

Enable Modified Hilite Group #36

Closed wmonk closed 5 years ago

wmonk commented 6 years ago

Hey, thanks for this plugin! I know this is completely unsolicited, but had seen an issue where this kind of thing was mentioned. This PR enables a hilite group for tabs that are modified. The order of precedence is shown below.

image

  1. current
  2. active
  3. modified
  4. hidden

I did see in #29 that you were talking about rewriting the display logic, so feel free to ignore this - regardless 😄

ap commented 6 years ago

Hi, thank you for the patch. Unsolicited is fine. 😊

I might just add this, even without the theming support.

But as is, I dislike that it’s enabled based on the indicators option, and I also think the precedence order is wrong… and it seems to me that the former is only necessary because of the latter.

I assume you know this already, but in case you don’t: Active is for buffers that are currently displayed in some window but not the current window. So your chosen precedence order means that once a buffer is modified, until it gets saved, it would no longer be apparent whether it’s being displayed anywhere or not. Is this something you considered and made your choice of precedence deliberately? If yes, what’s the reason you prefer it that way?

I think the order should be Current > Active > Modified > Hidden. And then the Modified highlight can be linked to the Hidden highlight by default, which makes it a no-op unless a colorscheme or the user’s config specifically changes the rendering. That would also remove the need to put it behind an option, and that in turn would allow users who don’t want indicator characters to still get some visual indication of modified buffers.