Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current buffer in lualine tabline component has same styling as inactive buffers #62

Open
nkhlmn opened this issue Jan 26, 2022 · 3 comments

Comments

@nkhlmn
Copy link

nkhlmn commented Jan 26, 2022

Operating system/version

macOS 11.6.1

Terminal emulator/version

kitty 0.24.1

$TERM environment variable

xterm-kitty

Tmux version

No response

Feature matrix

nvim: health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $COLORTERM='truecolor'

nvim-lsp-installer: require("nvim-lsp-installer.health").check()
========================================================================
## nvim-lsp-installer report
  - OK: neovim version >= 0.6.0
  - WARNING: **Composer**: not available
  - WARNING: **julia**: not available
  - ERROR: **wget**: not available
  - OK: **tar**: `bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.6`
  - OK: **gzip**: `Apple gzip 321.100.11`
  - OK: **curl**: `curl 7.64.1 (x86_64-apple-darwin20.0) libcurl/7.64.1 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.41.0`
  - OK: **python3**: `Python 3.9.10`
  - OK: **PHP**: `WARNING: PHP is not recommended`
  - OK: **Ruby**: `ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]`
  - OK: **bash**: `GNU bash, version 3.2.57(1)-release (arm64-apple-darwin20)`
  - OK: **sh**: `Ok`
  - WARNING: **javac**: not available
  - WARNING: **java**: not available
  - OK: **Go**: `go version go1.17.6 darwin/arm64`
  - OK: **RubyGem**: `3.0.3`
  - OK: **pip3**: `pip 21.3.1 from /opt/homebrew/lib/python3.9/site-packages/pip (python 3.9)`
  - OK: **node**: `v17.4.0`
  - OK: **npm**: `8.3.1`

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - OK: `tree-sitter` found 0.20.2 (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v17.4.0 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: Apple clang version 13.0.0 (clang-1300.0.29.30)
  - OK: Neovim was compiled with tree-sitter runtime ABI version 13 (required >=13). Parsers must be compatible with runtime ABI.

## Parser/Features H L F I J
  - c              ✓ ✓ ✓ ✓ ✓ 
  - go             ✓ ✓ ✓ ✓ ✓ 
  - jsdoc          ✓ . . . . 
  - vue            ✓ . ✓ ✓ ✓ 
  - css            ✓ . ✓ ✓ ✓ 
  - javascript     ✓ ✓ ✓ ✓ ✓ 
  - markdown       ✓ . ✓ . ✓ 
  - bash           ✓ ✓ ✓ . ✓ 
  - dockerfile     ✓ . . . ✓ 
  - make           ✓ . . . ✓ 
  - toml           ✓ ✓ ✓ ✓ ✓ 
  - typescript     ✓ ✓ ✓ ✓ ✓ 
  - python         ✓ ✓ ✓ ✓ ✓ 
  - rust           ✓ ✓ ✓ ✓ ✓ 
  - gomod          ✓ . . . ✓ 
  - http           ✓ . . . ✓ 
  - llvm           ✓ . . . . 
  - vim            ✓ ✓ . . ✓ 
  - lua            ✓ ✓ ✓ ✓ ✓ 
  - jsonc          ✓ ✓ ✓ ✓ ✓ 
  - tsx            ✓ ✓ ✓ ✓ ✓ 
  - json           ✓ ✓ ✓ ✓ . 
  - yaml           ✓ ✓ ✓ ✓ ✓ 
  - regex          ✓ . . . . 
  - cpp            ✓ ✓ ✓ ✓ ✓ 
  - ruby           ✓ ✓ ✓ ✓ ✓ 
  - graphql        ✓ . . ✓ ✓ 
  - html           ✓ ✓ ✓ ✓ ✓ 

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang}

provider: health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: pbcopy

## Python 2 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          /usr/bin/python2 does not have the "neovim" module. :help |provider-python|
          /usr/bin/python2.7 does not have the "neovim" module. :help |provider-python|
          python2.6 not found in search path or not executable.
          /usr/bin/python does not have the "neovim" module. :help |provider-python|
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 3:
          /opt/homebrew/bin/python3 does not have the "neovim" module. :help |provider-python|
          python3.10 not found in search path or not executable.
          /opt/homebrew/bin/python3.9 does not have the "neovim" module. :help |provider-python|
          python3.8 not found in search path or not executable.
          python3.7 not found in search path or not executable.
          python3.6 not found in search path or not executable.
          /usr/bin/python is Python 2.7 and cannot provide Python 3.
  - INFO: Executable: Not found

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.

## Node.js provider (optional)
  - INFO: Node.js: v17.4.0
  - INFO: Nvim node.js host: /opt/homebrew/lib/node_modules/neovim/bin/cli.js
  - OK: Latest "neovim" npm/yarn package is installed: 4.10.1

## Perl provider (optional)
  - ERROR: perl provider error:
    - ADVICE:
      - "Neovim::Ext" cpan module is not installed

telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary installed.
  - OK: nvim-treesitter installed.

## Checking external dependencies
  - OK: rg: found ripgrep 13.0.0
  - OK: fd: found fd 8.3.1

## ===== Installed extensions =====

## Telescope Extension: `file_browser`
  - INFO: No healthcheck provided

## Telescope Extension: `ui-select`
  - INFO: No healthcheck provided

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - INFO: LSP log level : WARN
  - INFO: Log path: /Users/nkhl/.cache/nvim/lsp.log
  - INFO: Log size: 704 KB

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 13
  - OK: Loaded parser for bash: ABI version 13
  - OK: Loaded parser for c: ABI version 13
  - OK: Loaded parser for cpp: ABI version 13
  - OK: Loaded parser for css: ABI version 13
  - OK: Loaded parser for dockerfile: ABI version 13
  - OK: Loaded parser for go: ABI version 13
  - OK: Loaded parser for gomod: ABI version 13
  - OK: Loaded parser for graphql: ABI version 13
  - OK: Loaded parser for html: ABI version 13
  - OK: Loaded parser for http: ABI version 13
  - OK: Loaded parser for javascript: ABI version 13
  - OK: Loaded parser for jsdoc: ABI version 13
  - OK: Loaded parser for json: ABI version 13
  - OK: Loaded parser for jsonc: ABI version 13
  - OK: Loaded parser for llvm: ABI version 13
  - OK: Loaded parser for lua: ABI version 13
  - OK: Loaded parser for make: ABI version 13
  - OK: Loaded parser for markdown: ABI version 13
  - OK: Loaded parser for python: ABI version 13
  - OK: Loaded parser for regex: ABI version 13
  - OK: Loaded parser for ruby: ABI version 13
  - OK: Loaded parser for rust: ABI version 13
  - OK: Loaded parser for toml: ABI version 13
  - OK: Loaded parser for tsx: ABI version 13
  - OK: Loaded parser for typescript: ABI version 13
  - OK: Loaded parser for vim: ABI version 13
  - OK: Loaded parser for vue: ABI version 13
  - OK: Loaded parser for yaml: ABI version 13


nvim: health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $COLORTERM='truecolor'

nvim-lsp-installer: require("nvim-lsp-installer.health").check()
========================================================================
## nvim-lsp-installer report
  - OK: neovim version >= 0.6.0
  - WARNING: **Composer**: not available
  - WARNING: **julia**: not available
  - ERROR: **wget**: not available
  - OK: **tar**: `bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.6`
  - OK: **gzip**: `Apple gzip 321.100.11`
  - OK: **curl**: `curl 7.64.1 (x86_64-apple-darwin20.0) libcurl/7.64.1 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.41.0`
  - OK: **python3**: `Python 3.9.10`
  - OK: **PHP**: `WARNING: PHP is not recommended`
  - OK: **Ruby**: `ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]`
  - OK: **bash**: `GNU bash, version 3.2.57(1)-release (arm64-apple-darwin20)`
  - OK: **sh**: `Ok`
  - WARNING: **javac**: not available
  - WARNING: **java**: not available
  - OK: **Go**: `go version go1.17.6 darwin/arm64`
  - OK: **RubyGem**: `3.0.3`
  - OK: **pip3**: `pip 21.3.1 from /opt/homebrew/lib/python3.9/site-packages/pip (python 3.9)`
  - OK: **node**: `v17.4.0`
  - OK: **npm**: `8.3.1`

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - OK: `tree-sitter` found 0.20.2 (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v17.4.0 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: Apple clang version 13.0.0 (clang-1300.0.29.30)
  - OK: Neovim was compiled with tree-sitter runtime ABI version 13 (required >=13). Parsers must be compatible with runtime ABI.

## Parser/Features H L F I J
  - c              ✓ ✓ ✓ ✓ ✓ 
  - go             ✓ ✓ ✓ ✓ ✓ 
  - jsdoc          ✓ . . . . 
  - vue            ✓ . ✓ ✓ ✓ 
  - css            ✓ . ✓ ✓ ✓ 
  - javascript     ✓ ✓ ✓ ✓ ✓ 
  - markdown       ✓ . ✓ . ✓ 
  - bash           ✓ ✓ ✓ . ✓ 
  - dockerfile     ✓ . . . ✓ 
  - make           ✓ . . . ✓ 
  - toml           ✓ ✓ ✓ ✓ ✓ 
  - typescript     ✓ ✓ ✓ ✓ ✓ 
  - python         ✓ ✓ ✓ ✓ ✓ 
  - rust           ✓ ✓ ✓ ✓ ✓ 
  - gomod          ✓ . . . ✓ 
  - http           ✓ . . . ✓ 
  - llvm           ✓ . . . . 
  - vim            ✓ ✓ . . ✓ 
  - lua            ✓ ✓ ✓ ✓ ✓ 
  - jsonc          ✓ ✓ ✓ ✓ ✓ 
  - tsx            ✓ ✓ ✓ ✓ ✓ 
  - json           ✓ ✓ ✓ ✓ . 
  - yaml           ✓ ✓ ✓ ✓ ✓ 
  - regex          ✓ . . . . 
  - cpp            ✓ ✓ ✓ ✓ ✓ 
  - ruby           ✓ ✓ ✓ ✓ ✓ 
  - graphql        ✓ . . ✓ ✓ 
  - html           ✓ ✓ ✓ ✓ ✓ 

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang}

provider: health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: pbcopy

## Python 2 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          /usr/bin/python2 does not have the "neovim" module. :help |provider-python|
          /usr/bin/python2.7 does not have the "neovim" module. :help |provider-python|
          python2.6 not found in search path or not executable.
          /usr/bin/python does not have the "neovim" module. :help |provider-python|
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 3:
          /opt/homebrew/bin/python3 does not have the "neovim" module. :help |provider-python|
          python3.10 not found in search path or not executable.
          /opt/homebrew/bin/python3.9 does not have the "neovim" module. :help |provider-python|
          python3.8 not found in search path or not executable.
          python3.7 not found in search path or not executable.
          python3.6 not found in search path or not executable.
          /usr/bin/python is Python 2.7 and cannot provide Python 3.
  - INFO: Executable: Not found

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.

## Node.js provider (optional)
  - INFO: Node.js: v17.4.0
  - INFO: Nvim node.js host: /opt/homebrew/lib/node_modules/neovim/bin/cli.js
  - OK: Latest "neovim" npm/yarn package is installed: 4.10.1

## Perl provider (optional)
  - ERROR: perl provider error:
    - ADVICE:
      - "Neovim::Ext" cpan module is not installed

telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary installed.
  - OK: nvim-treesitter installed.

## Checking external dependencies
  - OK: rg: found ripgrep 13.0.0
  - OK: fd: found fd 8.3.1

## ===== Installed extensions =====

## Telescope Extension: `file_browser`
  - INFO: No healthcheck provided

## Telescope Extension: `ui-select`
  - INFO: No healthcheck provided

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - INFO: LSP log level : WARN
  - INFO: Log path: /Users/nkhl/.cache/nvim/lsp.log
  - INFO: Log size: 704 KB

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 13
  - OK: Loaded parser for bash: ABI version 13
  - OK: Loaded parser for c: ABI version 13
  - OK: Loaded parser for cpp: ABI version 13
  - OK: Loaded parser for css: ABI version 13
  - OK: Loaded parser for dockerfile: ABI version 13
  - OK: Loaded parser for go: ABI version 13
  - OK: Loaded parser for gomod: ABI version 13
  - OK: Loaded parser for graphql: ABI version 13
  - OK: Loaded parser for html: ABI version 13
  - OK: Loaded parser for http: ABI version 13
  - OK: Loaded parser for javascript: ABI version 13
  - OK: Loaded parser for jsdoc: ABI version 13
  - OK: Loaded parser for json: ABI version 13
  - OK: Loaded parser for jsonc: ABI version 13
  - OK: Loaded parser for llvm: ABI version 13
  - OK: Loaded parser for lua: ABI version 13
  - OK: Loaded parser for make: ABI version 13
  - OK: Loaded parser for markdown: ABI version 13
  - OK: Loaded parser for python: ABI version 13
  - OK: Loaded parser for regex: ABI version 13
  - OK: Loaded parser for ruby: ABI version 13
  - OK: Loaded parser for rust: ABI version 13
  - OK: Loaded parser for toml: ABI version 13
  - OK: Loaded parser for tsx: ABI version 13
  - OK: Loaded parser for typescript: ABI version 13
  - OK: Loaded parser for vim: ABI version 13
  - OK: Loaded parser for vue: ABI version 13
  - OK: Loaded parser for yaml: ABI version 13

Minimal vimrc that can reproduce this bug.

Lualine config i'm using is below.:

require('lualine').setup({
    tabline = {
        lualine_a = { 'tabs' },
        lualine_c = { 'buffers' },
    }
})

Colorscheme related config i'm using:

local vim = vim
local o = vim.opt
local g = vim.g

o.termguicolors = true
o.background = 'dark'

g.everforest_background = 'hard'
g.everforest_sign_column_background = 'none'
g.everforest_diagnostic_text_highlight = true
g.everforest_diagnostic_line_highlight = true
g.everforest_diagnostic_virtual_text = 'colored'

Let me know if you need more info.

Steps to reproduce this bug using minimal vimrc

Enable the theme, use the lualine config above and open multiple buffers

Expected behavior

The current buffer should have a distinct styling to differentiate from the inactive buffers. This works as expected in gruvbox-material (see screenshot
Screen Shot 2022-01-26 at 10 48 23 AM
)

Actual behavior

Styling is the same for current/inactive buffers (see screenshot)
Screen Shot 2022-01-26 at 10 48 48 AM

@nkhlmn nkhlmn added the bug label Jan 26, 2022
@sainnhe
Copy link
Owner

sainnhe commented Jan 30, 2022

Actually lualine is designed to be a status line plugin, not a tab line plugin, although it actually provides functional elements for tab line.

Until now, there are no sections to define tab line colors, the tab line colors are actually inherited from colors defined in status line theme, check /lua/lualine/themes/everforest.lua.

After some debugging, I found that the tab line foreground colors are controlled by normal.c and inactive.c:

c = {bg = palette.bg1[1], fg = palette.grey1[1]}

c = {bg = palette.bg1[1], fg = palette.grey1[1]}

However normal.c and inactive.c are used to control the colors in normal mode and inactive mode in status line, which means that if we change them, not only the tab line theme but the status line theme will also be changed, which is not expected.

Due to the reason above, I'm not going to "fix" this issue because IMO this is not a bug will break the design of the status line.

If you want to have a nice tab line you should probably choose another tab line plugin.

As mentioned in the README of lualine:

If you want a more sophisticated tabline you can use other
tabline plugins with lualine too, for example:

tabline.nvim even uses lualine's theme by default 🙌
You can find a bigger list here.

@nkhlmn
Copy link
Author

nkhlmn commented Jan 31, 2022

Thanks for the explanation. More than happy with what lualine provides so another plugin just to fix this issue is not necessary as your other (also excellent) themes look fine. I'll just use those instead. Really appreciate all the work you've put into them.

@nkhlmn nkhlmn closed this as completed Jan 31, 2022
@P4Cu
Copy link

P4Cu commented Mar 26, 2023

@sainnhe Seems like lualine developer realized this problem and added new highlight groups:
lualine_a_tabs_active/inactive.
Might be worth to give a look again.

@antoineco antoineco reopened this Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

4 participants